diff --git a/lib/java/se/lth/control/labcomm2014/DecoderChannel.java b/lib/java/se/lth/control/labcomm2014/DecoderChannel.java index 1a819a23639c30e511699fe2222d4247b3fe4d67..7f653312bdb457d3b2bfce90abe5509d56496a71 100644 --- a/lib/java/se/lth/control/labcomm2014/DecoderChannel.java +++ b/lib/java/se/lth/control/labcomm2014/DecoderChannel.java @@ -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 {