Ubuntu uses Putty client remote connection to the server, may appear in the character interface Chinese garbled problem, the reason is: Ubuntu uses UTF-8 as the Chinese encoding by default. By default, Putty uses GB2312 to connect to the server. The inconsistency between the two causes Chinese garbled characters.
The solution is also very easy, that is, either to change the default Chinese encoding method of Ubuntu or to change the character set used when the Putty connection is used.
Change the default Chinese encoding mode in Ubuntu to GB2312.
### Method 1:
Open the putty main program, select window-> Appearance-> Font settings-> Change Settings, select the Fixedsys Font, and select CHINESE_GB2312 as the character set.
The code is as follows: |
Copy code |
In window-> Appearance-> Translation, modify Ed data assumed to be in which character set, change Use font encoding to UTF-8 |
If it is frequently used, save these settings in the session.
Save method: After completing the preceding operations, select the following two items:
In window-> Appearance-> Translation, select TReat CJK ambiguous characters as wide and Caps Lock acts as Cyrillic switch.
### Method 2:
Edit/etc/sysconfig/i18n
Change "LANG =" zh_CN.UTF-8 & Prime; "to" LANG = "zh_CN.GB18030 & Prime;", save and log on again.
# Method 3:
Open putty, and enter
The code is as follows: |
Copy code |
# Export LC_ALL = 'zh _ CN. utf8 & prime; # Vi ~ /. Bash_profile LANG = zh_CN.GB18030 LANGUAGE = zh_CN.GB18030: zh_CN.GB2312: zh_CN Export LANG LANGUAGE |
Method 4
The code is as follows: |
Copy code |
Modify file: /Var/lib/locales/supported. d/local Content: En_US.UTF-8 UTF-8 Zh_CN.UTF-8 UTF-8 Zh_CN.GBK GBK Zh_CN GB2312 After saving, run the following command: Sudo locale-gen |
Enable the system to support Chinese characters.
Solution 5:
Change Putty to transfer using UTF-8 encoding when connecting to the server (test successful)
Window-> Appearance-> Font settings: Select or: