Skip to content

Commit

Permalink
Fixed a bug that prevented Yacy from indexing files with non ASCII fi…
Browse files Browse the repository at this point in the history
…lenames 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.
  • Loading branch information
cymerio committed Aug 24, 2012
1 parent 29171e2 commit c2341a1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion source/net/yacy/cora/protocol/ftp/FTPClient.java
Expand Up @@ -1969,7 +1969,8 @@ private String reverse(final String s) {
// 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();
Expand Down

0 comments on commit c2341a1

Please sign in to comment.