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

Fail to read a text object #37

Open
tdiwasa opened this issue Dec 15, 2011 · 0 comments
Open

Fail to read a text object #37

tdiwasa opened this issue Dec 15, 2011 · 0 comments

Comments

@tdiwasa
Copy link

tdiwasa commented Dec 15, 2011

readStringFromStream() fails to create a string object
if a text object like below was given.

BT 1 0 0 1 0 1.9 Tm /F3+0 8.6 Tf 10.5 TL (\376\377 ) Tj T* ET

readStringFromStream() decodes (\376\377 ) to a string '\xfe\xff\x20'.

createStringObject() checks first 2 bytes of the string,
and will attempt to decode with UTF-16.
Then an exception will be raised because '\x20' is illegal as UTF-16.

Apparently, a text "\376\377" should not be treated as BOM.

BOM check would be a conformance of "Text Strings" described in PDF Reference,
but it should be applied only to the "text string" type item specified in PDF Reference.

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

No branches or pull requests

1 participant