psychoone7 / pyftpdlib

Automatically exported from code.google.com/p/pyftpdlib
Other
0 stars 0 forks source link

OPTS UTF8 ON and Windows Explorer FTP client #266

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Windows Explorer FTP client expected a success response to "OPTS UTF8 ON" 
command [1], otherwise it will assume the server doesn't support UTF-8 and 
display UTF-8 encoded filenames incorrectly.

This OPTS command isn't supported by pyftpdlib [2].

I've got a report in ftpclodfs related to this [3] and the workaround was 
simple: just return success to a "OPTS UTF8 ON" request [4].

I don't know if this is just windows not playing nice with standards but I find 
that implementing the OPTS command is harmless and fixes UTF-8 support in 
windows' default FTP client.

References:

 - [1]: https://tools.ietf.org/html/draft-ietf-ftpext-utf-8-option-00
 - [2]: http://code.google.com/p/pyftpdlib/wiki/RFCsCompliance#RFC-2389_-_Feature_negotiation_mechanism_for_the_File_Transfer_P
 - [3]: https://github.com/chmouel/ftp-cloudfs/issues/50
 - [4]: https://github.com/chmouel/ftp-cloudfs/commit/b4bef39fd394c147c2a85c4f25758bb1b14a9d1f

Original issue reported on code.google.com by useboxnet on 16 Jul 2013 at 10:49

GoogleCodeExporter commented 9 years ago
I forgot, the user reporting the problem is using Windows XP Professional, 
service pack 3, Chinese simplified encoding (GBK).

I've found reports like this with Windows Vista too.

Original comment by useboxnet on 16 Jul 2013 at 10:53

GoogleCodeExporter commented 9 years ago
It is Windows Explorer FTP client which is not compliant, because the RFC you 
mentioned is not a standard.

As per RFC-2640 client and server should just use UTF-8 by default. 
Expressively enabling it via OPTS is uncompliant and I find astonishing that a 
company like Microsoft, with thousands of developers, can produce software of 
this quality.

That said...

<compliant mode off =)>

...it might make sense to reply with a positive response and just "do nothing" 
(albeit on the other hand I'm not sure what to do in case of "OPTS UTF8 OFF").
I'm gonna check what proftpd does in this regard and reply here.

Original comment by g.rodola on 16 Jul 2013 at 12:55

GoogleCodeExporter commented 9 years ago
...and even the non-standard RFC that the OP linked to said the command should 
be "OPTS UTF-8" which is different in two regards to the "OPTS UTF8 ON" that 
Windows Explorer is apparently sending!
Embrace and Extend, anyone? ;-)

Original comment by gc...@loowis.durge.org on 16 Jul 2013 at 1:29

GoogleCodeExporter commented 9 years ago
I totally agree with you.

If you google a little bit you'll that other projects had the same problem.

Original comment by useboxnet on 16 Jul 2013 at 1:29