In ubuntu, garbled characters occur when gedit opens the GBK character set encoding file. Solution

Source: Internet
Author: User

In ubuntu, garbled characters occur when gedit is used to open the GBK character set encoding file. Solution: When Gedit is used to open a text file written in Windows, all Chinese characters in the file are garbled. Some txt files that can be opened in Windows are opened in gedit In Ubuntu. Chinese characters are garbled because of different encoding methods. In Windows, the default txt file encoding method is GBK, while in Ubuntu, gedit does not support GBK by default. Www.2cto.com: Open the terminal and enter the following two Commands: gsettings set org. gnome. gedit. preferences. encodings auto-detected "['gb18030', 'gb2312', 'gbk', 'utf-8', 'big5', 'current ', 'utf-16'] "gsettings set org. gnome. gedit. preferences. encodings shown-in-menu "['gb18030', 'gb2312', 'gbk', 'utf-8', 'big5', 'current ', 'utf-16'] "restart Gedit to display Chinese content normally. The preceding two commands are equivalent to opening the application-system tool-configuration editor (or entering: gconf-editor in the terminal -- this software needs to be installed -- executing sudo apt-get install gconf-editor ), create the auto-detected shown-in-menu Sub-keys under apps/gedit-2/preferences/encodings. The sub-key content is as follows. After completing the preceding settings, gedit can automatically detect the character set of the text file and correctly display the text created in windows as a GBK file.
 

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.