Skip to content
Snippets Groups Projects
Commit 34c0d9cd authored by Anders Blomdell's avatar Anders Blomdell
Browse files

Made java decoding of strings to explicitly use UTF8

parent 3516e518
Branches
Tags
No related merge requests found
......@@ -5,9 +5,12 @@ import java.io.DataInputStream;
import java.io.InputStream;
import java.io.IOException;
import java.io.EOFException;
import java.nio.charset.Charset;
public class DecoderChannel implements Decoder {
private final Charset UTF8_CHARSET = Charset.forName("UTF-8");
private DataInputStream in;
private DecoderRegistry def_registry = new DecoderRegistry();
private DecoderRegistry ref_registry = new DecoderRegistry();
......@@ -131,7 +134,7 @@ public class DecoderChannel implements Decoder {
for(int i=0; i<len; i++) {
chars[i] = in.readByte();
}
return new String(chars);
return new String(chars, UTF8_CHARSET);
}
public int decodePacked32() throws IOException {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment