Solve Chinese garbled characters in Linux (Ubuntu) and add Chinese character sets

Source: Internet
Author: User
Solve Linux (Ubuntu) Chinese garbled characters, add Chinese character set linuxubuntu Chinese garbled character set add Chinese character encoding: Java code $ sudovim/var/lib/locales/supported. d/local # add the following Java code zh_CN.GBKGBKzh _... solve Linux (Ubuntu) Chinese garbled characters, add Chinese character set linuxubuntu Chinese garbled character set add Chinese character encoding: Java code $ sudo vim/var/lib/locales/supported. d/local # add the following Java code zh_CN.GBK GBK zh_CN.GB2312 GB2312 zh_CN.GB18030 GB18030 for the Chinese character set to take effect: Java code $ sudo dpkg-reconfigure locales vim: Open the vim configuration file, the location is in/etc/vim. Rc adds the Java code set fileencodings = UTF-8, gb2312, gbk, gb18030 set termencoding = UTF-8 set encoding = prc save and exit the Java code source/etc/vim/vimrc. now vim can correctly display Chinese characters. -------------------------------------------------------------- 'PDF: java code $ sudo apt-get install xpdf-chinese-simplifiedxpdf-chinese-traditional # install the chinese font of pdf Java code $ sudo apt-get install poppler-data # Installation Solution pdf chinese display garbled Software $ cd/etc/fonts/conf. d $ sudo cp 49-sansserif.conf 49-sansserif.conf_backup # back up $ sudo rm 49-sansserif.conf # delete the file in the open PDF file to display Chinese characters properly. gedit: default configuration, use the Ubuntu text editor (gedit) to open GB18030/GBK/ Garbled characters may appear in Chinese encoded text files such as GB2312. This is because gedit uses an encoding matching list. only the encoding in this list is matched. encoding not in this list is garbled. All you need to do is add GB18030 to the matching list. Command line method, applicable to all Ubuntu users. Copy the following command to the terminal and press enter: gconftool-2 -- set -- type = list -- list-type = string/apps/gedit-2/preferences/encodings/auto_detected "[UTF-8, CURRENT, GB18030, BIG5-HKSCS, UTF-16] "graphical approach for Ubuntu users, not KUbuntu/XUbuntu users. Follow these steps to make your gedit correctly display the Chinese encoding file. Press the Alt-F2 to open the run Application dialog box. In the text box, type "gconf-editor" and press the Enter key to open "configuration editor ". Expand the tree node on the left, find the/apps/gedit-2/preferences/encodings node, and click it. Double-click the auto_detected key on the right to open the edit key dialog box. Click Add on the right of the list, enter GB18030, and click OK. A "GB18030" is added at the bottom of the list ". Click select it, and click the "up" button on the right until "GB18030" is at the top of the list. Click OK to close the configuration editor. In gedit3.x, enter dconf-editor to expand the org/gnome/gedit/preferences/encodings auto-detected value, add 'gb18030' to the value, and add it to the end of uft8; 'gb18030' is added to the show-in-menu value. now, your gedit should be able to smoothly open the GB18030 encoded text file. Gedit 3. command setting for version X: gsettings set org. gnome. gedit. preferences. encodings auto-detected "['utf-8', 'gb18030', 'gb2312', 'gbk', 'big5', 'current', 'utf-16']"
Related Article

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.