The length of a UTF-16-BE string appears to be expressed in the number of
double bytes and not single bytes. The current code incorrectly parses the
attached file -- the string is truncated to half its correct length.
I fixed the problem by multiplying the length by two, in the 0x6 case:
if (intLength < 3) {
length = (int) parseUnsignedInt(copyOfRange(bytes, offset + 2, offset + 2 + intLength)) * 2;
} else {
length = new BigInteger(copyOfRange(bytes, offset + 2, offset + 2 + intLength)).intValue() * 2;
}
Original issue reported on code.google.com by robert.c...@gmail.com on 28 May 2011 at 2:42
Original issue reported on code.google.com by
robert.c...@gmail.com
on 28 May 2011 at 2:42Attachments: