Performing echo $ LANG is the current command output encoding is performed locale command to get all the available coding system. Let Xshell not garbled, will have to encoding to UTF-8.
1. Xshell in [file] -> [open] -> select that, click on the properties connected in an open session in -> [Terminal], select UTF-8 on the right translation, and then reconnect to the server.
2. A more effective method is simpler: (set above in this way is no problem when the coding is still garbled, then the issue is not Xshell, which is simply Centos coding problems)
Execute commands in a terminal:
export LC_ALL=zh_CN.GB2312;export LANG=zh_CN.GB2312
or
echo 'export LANG='zh_CN.UTF8''>>/etc/profile
source /etc/profile
It is OK