-
Notifications
You must be signed in to change notification settings - Fork 243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
if utf8 filename #124
Comments
This did not fix the problem for me. When I retrieve a directory listing on my server, chars like äöü are messed up. They seem to be encoded twice. I have tried the ascii option but this does not helps. It looks like data over a PASV connection is always treated as binary, but some commands, like CWD,PWD and LIST should be treated as UTF-8 text. Modern FTP Servers (for example FileZilla Server) have UTF-8 always on and it cannot be turned off (OPTS utf8 OFF) |
I'd be open to a PR that checks for the UTF-8 feature (enabling it if possible) and then using UTF-8 encoding for non-file transfers if said feature is available. The |
@mscdex A server announces this feature in the FEAT command:
|
The solution from @yanmingsohu has worked in the end. I was piping the output directly to the http component (to make a http frontend for ftp if somebody is interested) where it got mangled. I will make a PR addressing this. |
I just did: #125 This will prevent double escaping of UTF-8. If the server operates in true ascii mode this should not mess up as well, as ascii is only the lower 127 bytes and UTF-8 is identical in this case. to detect utf-8 I would do something like:
on line 235 of connection.js |
modify 434: var sockerr, done = false, replies = 0, entries, buffer = [], source = sock;
modify 441: source.on('data', function(chunk) { buffer.push(chunk); });
insert 455: buffer = Buffer.concat(buffer).toString();
The text was updated successfully, but these errors were encountered: