Fix handling of UTF16-LE annotations
Submitted by Christophe Fergeau
Assigned to poppler-bugs
Created attachment 134538 Test case
The 'unicode' annotation in the attached test case does not render properly. I added it through the default mail application on my iOS11 iphone. I trade that down to _poppler_goo_string_to_utf8() which assumes UTF16 strings will always be big endian, while in my test file, a little endian UTF16 string is used. I've fixed this by adding 2 new methods to GooString (hasBigEndianBOM() hasLittleEndianBOM()), but all users of GooString::hasUnicodeMarker() should probably be audited and handle both types of UTF16 strings unless the pdf specs mandates big endian strings. Since I'm not familiar at all with the PDF format, I haven't tried to address this yet.
Attachment 134538, "Test case":