The simplest solution
Solve garbled characters:
Modify/etc/default/locale
Sudo vim/etc/default/locale1
Modify the default
LANG = zh_CN.UTF-8
LANGUAGE = zh_CN: zh
Is:
LANG = "en_US.UTF-8"
LANGUAGE = "en_US: en"
The following are some solutions for garbled characters:
I. Garbled FLASH in webpages
FLASH text will show "mouth"
After the flash plug-in is installed in the firefox browser, you may find that Chinese characters will change to boxes.
How can this problem be solved?
Input:
Cd/etc/fonts/conf. d/
For security, back up:
Sudo cp 49-sansserif.conf 49-sansserif.conf_backup
Enter the following command:
Sudo gedit./49-sansserif.conf
The content of the file is displayed.
Replace "sans-serif" or "serif" after "1st, 2, and 4" with the names in Chinese fonts supported by your system. Note that the font names are case-sensitive.
For example, I use WenQuanYi zheng, and I use "WenQuanYi zheng" to replace the above-mentioned fields. The result is as follows:
<Match target = "pattern">
<Test qual = "all" name = "family" compare = "not_eq">
<String> WenQuanYi zhenghei </string>
</Test>
<Test qual = "all" name = "family" compare = "not_eq">
<String> WenQuanYi zhenghei </string>
</Test>
<Test qual = "all" name = "family" compare = "not_eq">
<String> monospace </string>
</Test>
<Edit name = "family" mode = "append_last">
<String> WenQuanYi zhenghei </string>
</Edit>
</Match>
Close the browser and restart to see if the font display is normal?
II. Open the TXT file with garbled characters
This problem seems to have occurred only when ubuntu was upgraded to 9.04. Many novels or their own notes were in the. TXT file.
Open the. TXT file in ubuntu and garbled characters are displayed in Chinese. Here we find a solution:
Enter gconf-editor to call up gconf-edit.
PS: enter gconf-editor. You do not need to add Sudo before.
Click Start in sequence //111cn.net
Apps-> gedit-2-> preferences-> auto-detected in encodings
In the double-click dialog box, add GB18030, GBK, and GB2312, and move GB18030, GB2312 to the top
Open the. Txt file again. Is the problem solved?
3. Garbled characters in the Audacious player list
I have introduced a ubuntu music player Audacious before. Do you know you have installed it?
Have you found garbled characters in the playlist display?
Maybe you have solved the problem, but here I still want to write a solution!
After Audacious is installed and added to the playlist, your display may be as follows:
Solution:
Open the menu (click the upper left corner of the interface, or right-click in the blank area)-preference
After entering, select the playlist on the left, and select custom from show songs to title format on the right.
Enter "%" below, that is, the percentage sign. Click close and restart the program to check whether the playlist is normal?
4. Garbled information about songs in Rhythmbox
Solution:
Install mutagen: sudo apt-get install python-mutagen first
Then go to your MP3 Directory. For example, if my song is placed in the system's music folder, enter cd/home/holmesrain (this is my username, and you need to change it to your username) /music
Execute the full command to convert: mid3iconv-e GBK *. mp3
Use Rhythmbox to re-import the song folder!
V. Garbled wine
Solution:
Select browse C: driverfrom the wine menu, enter the Windows folder, and double-click the regedit.exe file.
Search: LogPixels
The row should be HKEY_LOCAL_MACHINESystemCurrentControlSetHardware ProfilesCurrentSoftwareFonts.
Replace the following:
"LogPixels" = dword: 00000060
Changed:
"LogPixels" = dword: 00000070
Search: FontSubstitutes
The row should be: HKEY_LOCAL_MACHINESoftwareMicrosoftWindows NTCurrentVersionFontSubstitutes
Replace the following:
"MS Shell Dlg" = "Tahoma"
"MS Shell Dlg 2 & Prime; =" Tahoma"
Changed:
"MS Shell Dlg" = "SimSun"
"MS Shell Dlg 2 & Prime; =" SimSun"
Exit the registry and you will find everything is OK.
6. pdf garbled
$ Sudo apt-get install xpdf-chinese-simplifiedxpdf-chinese-traditional # install the chinese font of pdf
$ Sudo apt-get install poppler-data # install the software to fix garbled characters in pdf
$ Cd/etc/fonts/conf. d
$ Sudo cp 49-sansserif.conf 49-sansserif.conf_backup # back up
$ Sudo rm 49-sansserif.conf # Delete
When you open a PDF file, you will be able to properly display Chinese characters.
7. Garbled gedit
By default, garbled characters are displayed when you use the Ubuntu text editor (gedit) to open Chinese-encoded text files of the GB18030, GBK, and GB2312 types.
The reason for this is that www.111cn.net, gedit uses an encoding matching list. Only the encoding in this list will be matched. Encoding not in this list will be garbled. All you need to do is add GB18030 to the matching list.
• The command line method is 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 mode, applicable to Ubuntu users, not KUbuntu/XUbuntu users.
Follow these steps to make your gedit correctly display the Chinese encoding file.
1. Press Alt-F2 to open the run Application dialog box.
2. Type "gconf-editor" in the text box and press the Enter key to open "configuration editor ".
3. Expand the tree node on the left, find the/apps/gedit-2/preferences/encodings node, and click it.
4. Double-click the auto_detected key on the right to open the "Edit key" dialog box.
5. Click "add" on the right of the list, enter "GB18030", and click "OK.
6. 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.
7. Click OK to close the configuration editor.
Gedit3.x version settings
Terminal input dconf-editor
Expand org/gnome/gedit/preferences/encodings
Add 'gb18030 & prime; to the value of auto-detected, and add it to the end of uft8;
Add 'gb18030 & prime;
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']"