Skip to content

Commit

Permalink
Fix some charset issues in ETF decoder
Browse files Browse the repository at this point in the history
  • Loading branch information
MinnDevelopment committed Jul 28, 2020
1 parent ce08dce commit 2027531
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ private static Object unpackAtom(ByteBuffer buffer, Charset charset)

private static Object unpackAtom(ByteBuffer buffer, Charset charset, int length)
{
String value = getString(buffer, StandardCharsets.ISO_8859_1, length);
String value = getString(buffer, charset, length);
switch (value)
{
case "true": return true;
Expand All @@ -249,11 +249,11 @@ private static Object unpackAtom(ByteBuffer buffer, Charset charset, int length)
}
}

private static String getString(ByteBuffer buffer, Charset encoding, int length)
private static String getString(ByteBuffer buffer, Charset charset, int length)
{
byte[] array = new byte[length];
buffer.get(array);
return new String(array, StandardCharsets.UTF_8);
return new String(array, charset);
}

private static List<Object> unpackList0(ByteBuffer buffer)
Expand Down

0 comments on commit 2027531

Please sign in to comment.