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 displayed in Chinese when you use gedit in Ubuntu... 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.
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.