On Thu, Apr 29, 2010 at 05:37:18PM +0800, Henry Hu wrote:
> However, lftp still issues a "LANG" command after the FEAT response.
> When it receives the response of LANG, it sets encoding to UTF-8.
According to the same RFC2640 (4.1 The LANG command):
Once negotiated, server-PI
MUST return server messages and textual part of command responses in
the negotiated language and encoded in UTF-8.
Also (3.2 Servers compliance):
- Servers MUST support the UTF-8 feature in response to the FEAT
command [RFC2389].
So your server does not completely comply to RFC2640 too.
> Since the server uses GBK in fact, the filenames in Chinese are
> garbled.
> Since there's such passage in RFC 2640:
> - Clients MUST support the FEAT command and recognize the "UTF8"
> feature (defined in 3.2 above) to determine if a server supports
> UTF-8 encoding.
> So I think that lftp should check that if UTF8 is supported, and if
> true, set the connection encoding to UTF8.
> I made such a patch:
I'll apply this patch as it only affects non-compliant servers.
Thank you!
> And it works correctly here, with ProFTPd.
> I understand that maybe some servers do not report "UTF8" in the FEAT,
> but report "LANG", and supports UTF8. So maybe this needs more work.
It's no problem actually, as it is easy to set ftp:charset setting.
--
Alexander.