Ubuntu character encoding settings Ubuntu system only supports Chinese UTF-8 encoding in the default condition, but some of the documents we write and Java code are compiled with GBK encoding. So it needs to be modified. The steps are as follows: www.2cto.com first step: gedit/var/lib/locales/supported.d/local to modify the/var/lib/locales/supported.d/local file, Add the following content to the file: ZH_CN. GBK GBKZH_CN. GB2312 GB2312ZH_CN. UTF-8 UTF-8 Step Two: sudo dpkg-reconfigure--force locales Force update settings. Step three: Add or modify the Red section in/etc/environment: Path= "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" Export Java_home=/home/qujianfeng/java/jdk1.6.0_37export Jre_home=/home/qujianfeng/java/jdk1.6.0_37/jreexport Classpath= $CLASSPATH: $JAVA _home/lib: $JAVA The system needs to be restarted after completing the steps above _home/jre/lib. After completion of www.2cto.com, found that after the Tomcat boot, its JVM is still UTF-8 encoding, the program output some Chinese will be garbled, so you need to set the JVM character encoding when booting: Fourth step: In tomcat/bin/ Add a red section to the catalina.sh:
# OS specific support. $var _must_ is set to either true or False.cygwin=falseos400=falsedarwin=false fifth step: After starting Tomcat, the background information is garbled, set the terminal code for GBK:
Sixth step: Gedit Open the GBK format in Chinese garbled. WORKAROUND: The default configuration, the Ubuntu text Editor (gedit) to open the type of gb18030/gbk/gb2312 and other types of Chinese-encoded text files, will appear garbled. Www.2cto.com This occurs because Gedit uses an encoding matching list, only the encoding in this list will match, and the encoding that is not in this list will be displayed as garbled. All you have to do is add GB18030 to this matching list. In terminal execution: Gsettings set org.gnome.gedit.preferences.encodings auto-detected "[' UTF-8 ', ' GB18030 ', ' GB2312 ', ' GBK ', ' BIG5 ', ' Current ', ' UTF-16 '] "OK, so the settings are all set."
Character encoding settings in Ubuntu