Article Title: Practical Tips: Solve the Chinese problems of Samba and Shell. Linux is a technology channel of the IT lab in China. Some basic classification Linux servers, such as desktop applications, Linux system management, kernel research, embedded systems, and open source, sometimes have the following problems:
(1) files uploaded through samba may sometimes fail to be displayed in ftp or shell.
(2) At the same time, files uploaded through ftp cannot be normally displayed in samba. Why?
The reason is that their character set is different.
Solution:
Step 1: Check whether the shell language is Chinese.
Echo $ LANG
If it is displayed as zh_CN. *****, there is basically no problem. You can skip this step. If it is en_US. *****, you must change it to Chinese by setting it in/etc/sysconfig/i18n.
LANG = "zh_CN.GBK", LANG = "zh_CN.GB2312", LANG = "zh_CN.GB18030" or LANG = "zh_CN.UTF-8"
Or you can directly use export LANG = zh_CN.GBK. For more information, see the linux settings.
Step 2 is also the most critical step. It is to change the smb. conf settings: add the code in the [global] domain
shell charset= cp936display charset= cp936dos charset= cp936unix charset= cp936client code page = 936character set = 936
|
In this way, the samba file name created under shell can be seen normally, and the shell file name created by samba can also be displayed normally. Most ftp does not have its own character set conversion system, and shell is used.
Therefore, you do not need to set this parameter unless necessary.