Setting the default Java character encoding

后端 未结 17 1753
终归单人心
终归单人心 2020-11-21 06:09

How do I properly set the default character encoding used by the JVM (1.5.x) programmatically?

I have read that -Dfile.encoding=whatever used to be the

17条回答
  •  渐次进展
    2020-11-21 06:40

    We were having the same issues. We methodically tried several suggestions from this article (and others) to no avail. We also tried adding the -Dfile.encoding=UTF8 and nothing seemed to be working.

    For people that are having this issue, the following article finally helped us track down describes how the locale setting can break unicode/UTF-8 in Java/Tomcat

    http://www.jvmhost.com/articles/locale-breaks-unicode-utf-8-java-tomcat

    Setting the locale correctly in the ~/.bashrc file worked for us.

提交回复
热议问题