Character encoding settings in Ubuntu

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.