Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UTF-16-BE Strings are not properly parsed #7

Closed
GoogleCodeExporter opened this issue May 23, 2015 · 2 comments
Closed

UTF-16-BE Strings are not properly parsed #7

GoogleCodeExporter opened this issue May 23, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

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

Attachments:

@GoogleCodeExporter
Copy link
Author

Thanks for pointing that out.
Fixed in r16.

Original comment by daniel.dreibrodt on 1 Jul 2011 at 7:37

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

Original comment by daniel.dreibrodt on 25 Sep 2014 at 5:52

  • Changed state: Verified

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant