Permalink
Browse files

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

  • Loading branch information...
1 parent 823e689 commit d63910154648e1cd8328230fd4ffe726b6bc45af @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 d639101

Please sign in to comment.