Fixed a bug that prevented Yacy from indexing files with non ASCII filenames in FTP servers.

Previously Yacy could read file listings in UTF-8, but couldn't send commands to the FTP server in UTF-8 (the second byte of every multi-byte character was ignored), which caused a lot of errors on the server side.
Now it handles UTF-8 correctly.
pull/1/head
David Rubio 12 years ago
parent 29171e2f6c
commit c2341a175f

@ -1969,7 +1969,8 @@ public class FTPClient {
// protocoll socket commands
private void send(final String buf) throws IOException {
this.clientOutput.writeBytes(buf);
byte[] b = buf.getBytes("UTF-8");
this.clientOutput.write(b, 0, b.length);
this.clientOutput.write('\r');
this.clientOutput.write('\n');
this.clientOutput.flush();

Loading…
Cancel
Save