How to Fix Garbled Characters in SUSE Linux Command Output
Question
How do I fix garbled characters in the SUSE Linux command output?
- If garbled characters are displayed on the screen after you run the ls command, it indicates that the directory involving the garbled characters is created according to another character set and certainly information cannot be properly displayed according to the current character set. After you modify the character set, the directory previously involving the garbled characters can be properly displayed. For directories that previously do not involve the garbled characters, however, garbled characters are likely to occur according to the new character set. This problem does not affect NMS operations. You need to care about only the information on directories that can be properly displayed according to the current character set.
- If the length of the characters displayed on the screen is greater than the width of the command line window, garbled characters may also be displayed on the screen.
Answer
- Scenario 1: If you are using the PuTTY tool, perform the following operations to modify the character set of the PuTTY tool.
- Right-click the tool bar in the PuTTY command line window. A shortcut menu is displayed. Choose Change Settings from the shortcut menu. The PuTTY Reconfiguration dialog box is displayed.
- Choose Window > Translation to check the value of Received data assumed to be in which character set.
For the PuTTY tool, the character set for the root user should be Use font encoding and that for the ossuser user should be UTF-8. If the current user matches the character set but garbled characters are still displayed on the screen, modify the character set using the following method:
- If the current value is Use font encoding, select UTF-8 from the drop-down list box.
- If the current value is UTF-8, select Use font encoding from the drop-down list box.
- Scenario 2: If you are using the terminal window of the server, perform the following operations to modify the character set of the terminal window of the server.
In the terminal window of the server, choose Terminal > Set Character Code to view the character set.
For the terminal window based on the SUSE Linux operating system, the character set for the root user should be GB2312 and that for the ossuser user should be UTF-8.
If the current user matches the character set but garbled characters are still displayed on the screen, modify the character set using the following method:
On the SUSE Linux operating system:
- If the current value is GB2312, select UTF-8 from the drop-down list box.
- If the current value is UTF-8, select GB2312 from the drop-down list box.