第一步:安裝locale
vi /etc/default/locale
LANG="zh_CN.gb2312"
cd /usr/share/locales
ls
install-language-pack remove-language-pack
./install-language-pack zh_CN
Generating locales...
zh_CN.UTF-8... done
Generation complete.
dpkg-trigger: dpkg-trigger must be called from a maintainer script (or with a --by-package option)
第二步:在Ubuntu下生成GBK或GB2312的locale
1.修改/var/lib/locales/supported.d/local文件,在文件中添加
zh_CN.GBK GBK
zh_CN.GB2312 GB2312
2.sudo dpkg-reconfigure --force locales
然後在輸出的結果中會出現
zh_CN.GB2312 done
zh_CN.GBK done
第三步:修改smb.conf
vi /etc/samba/smb.conf
根據locales的設置,修改該文件:
1. 如果locale是zh_CN.UTF-8,做如下設置:
display charset = UTF-8
unix charset = UTF-8
dos charset = UTF-8
2. 如果locale是zh_CN.GBK或zh_CN.gb2312,做如下設置:
display charset = cp936
unix charset = cp936
dos charset = cp936
重啓samba:
service samba restart
則無論從windows的網上鄰居,還是直接用securecrt登陸,均可顯示正常中文.