Comment 59 for bug 222635

Revision history for this message
In , Michal-novotny (michal-novotny) wrote :

Following check doesn't detect UTF8 in reply from proftpd:

+ if (mResponseMsg.Find(NS_LITERAL_CSTRING("UTF8" CRLF), PR_TRUE) > -1) {

The most correct check would be (CRLF " UTF8" CRLF), but proftpd is buggy and sends LF only instead of CRLF. So we should use some more relaxed check like:

(mResponseMsg.Find(NS_LITERAL_CSTRING(CRLF " UTF8" CRLF), PR_TRUE) > -1 ||
 mResponseMsg.Find(NS_LITERAL_CSTRING(LFSTR " UTF8" LFSTR), PR_TRUE) > -1)

The reason why there are problems with server ftp.asu.ru after applying your patch is that mPath is converted to originCharset when response to FEAT is received. But this happens only for the first request on the connection. Other requests that reuses the connection don't send FEAT command...

And I've found another problem. When server says that it supports UTF-8 but some filenames aren't valid UTF-8 strings, then conversion fails at http://mxr.mozilla.org/mozilla-central/source/netwerk/streamconv/converters/nsDirIndexParser.cpp#297 and such files aren't in the listing at all.