分类: LINUX
2011-10-10 12:04:25
FlashFXP 在站点管理器的高级里设置 utf-8 编码,然后设置字体为中文即可正常浏览。
現在系統環境幾乎都是用 UTF-8 編碼, 使用不支援 UTF-8 編碼的 FTP Client 例如 IE 就會看到亂碼.
configure 時加上 --enable-nls 參數
在 proftpd.conf 加上 UseEncoding local-charset client-charset (此參數 1.3.2rc1 以後才有)
例如:
繁體中文環境 UseEncoding UTF-8 Big5
簡體中文環境 UseEncoding UTF-8 GBK
如 此用 不支援 UTF-8 編碼的 FTP Client 連上來, ProFTPD 就會自動轉碼成 client-charsetubuntu安装了proftpd ,因为ubuntu默认服务器编码是utf-8 ,而所有windows的ftp客户端都默认使用gbk或是gb2312编码,所以导致服务器上正常的中文文件名,在客户端上看起来都是乱码;而用户通过 这些客户端在服务器上建立的看起来正常的中文文件名,在服务器上看起来又是乱码了。
google了一下,未果, 基本都是要求windows客户端换成某种可强行utf8的ftp软件,不现实且不灵活。看到有一个rc版,里面的news提到了一个UseEncoding参数,提及到了相关这方面的问题,于是下载测试,完全OK。
下载:
Candidate: 1.3.2rc1
[ RELEASE_NOTES ]
[ NEWS ] [ gz ] [ bz2 ]
安装:
sudo mv proftpd-1.3.2rc1.tar.gz /usr/local
cd /usr/local
sudo tar zxvf xxxx.tar.gz
cd proftp-1.3.2rc1
sudo ./configure --prefix=/usr/local/proftpd --enable-autoshadow --enable-auth-pam -enable-dso --enable-nls --enable-shadow --disable-ipv6
sudo make
sudo make install
配置:
sudo vi /usr/local/proftpd/etc/proftpd.conf
在 以下你需要配置的区间"server config", , 里面加上UseEncoding UTF-8 GBK
保存,退出,重启动proftpd ,测试 ,搞定
官方文档:
UseEncoding
Syntax: UseEncoding on|off|local-charset client-charset
Default: None
Context: "server config", ,
Module: mod_lang
Compatibility: 1.3.2rc1
The UseEncoding directive is used to explicit configure which character
sets should be used for encoding. By default, the mod_lang will
automatically discover the local character set, and will use UTF8 for
the client character set. The module will also allow the use of UTF8
encoding to be changed by clients using the OPTS UTF8 command (as per
RFC2640). However, if the UseEncoding directive is explicitly used to
indicate the character sets to use (or not use), then any OPTS UTF8
commands used by clients will be refused.
For example, to disable all use of encoding, use the following in your
proftpd.conf:
UseEncoding off
Similarly, to enable use of UTF8 encoding and to not allow clients to
change the use of UTF8, you would use:
UseEncoding on
In addition to the on|off parameters, the UseEncoding directive allows
administrators to specify exactly which character sets to use locally
(i.e. for paths on local disks) and for dealing with clients. One such
usage this way might look like:
UseEncoding koi8-r cp1251
For a full list of the character sets which are supported, use:
$ iconv --list