Permalink
Browse files

Fix unsigned bug in 8859-16 decode loop. #1214

  • Loading branch information...
1 parent 288e68e commit 6ab90582e69c009079f0df9b72c1b58120443958 @headius headius committed Nov 12, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 core/src/main/java/org/jruby/util/encoding/ISO_8859_16.java
@@ -69,7 +69,7 @@ protected CoderResult decodeLoop(ByteBuffer in, CharBuffer out) {
for (;;) {
if (!in.hasRemaining()) return CoderResult.UNDERFLOW;
if (!out.hasRemaining()) return CoderResult.OVERFLOW;
- byte b = in.get();
+ int b = in.get() & 0xFF;
char c = TABLE[b];
out.put(c);
}

0 comments on commit 6ab9058

Please sign in to comment.