使 ProFTPD 支援 UTF-8


我的 Linux 機器目前全部使用 UTF-8, 因此 ftp server 也跟著得使用 UTF-8. 而當使用 FileZillaSmartFTP 連上 ProFTPD 時, 預設是無法顯示 UTF-8 的中文, 除非把 SmartFTP/FileZilla 的強制使用 UTF-8 打開才能看到. 不過有些軟體即使強制使用 UTF-8 還是無法看到正確的文字 (譬如 FTPRush).

本來以為是 FTPRush 的問題, 不過後來發現應該是 ProFTPD 也有問題, 目前的解決方法如下
1. 重新編譯 ProFTPD, 加上參數 --enable-nls
2. 把 ftp client (filezilla, smartftp, ftprush) 的 FEAT 指令打開

於是在連線上 proftpd 的時候, 當 ftp client 送出 FEAT 指令後, 應該會收到下列訊息, features 的種類會依據您 server 打開的功能而有所不同, 重點是會顯示重點是會顯示 UTF8.

FEAT
211-Features:
 LANG en
 MDTM
 UTF8
 REST STREAM
 SIZE
211 End

然後 ftp client 會再送出 OPTS UTF8 ON, 如下:

OPTS UTF8 ON
200 UTF8 set to on

之後 FTPRush 就可以正常顯示 UTF-8 的文字了, 而 FileZilla, SmartFTP 也不需要強制使用 UTF-8, 只要打開 FEAT 就可以了.


Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
  • Textual smileys will be replaced with graphical ones.
  • You can enable syntax highlighting of source code with the following tags: <code>. Beside the tag style "<foo>" it is also possible to use "[foo]".
  • You may link to Gallery2 items on this site using a special syntax.
  • Insert Flickr images: [flickr-photo:id=230452326,size=s] or [flickr-photoset:id=72157594262419167,size=m].
  • You may insert videos with [video:URL]

More information about formatting options