Bug 47179 - [PATCH] hsmf - Enconding error when using POIFSChunkParser on Linux
[PATCH] hsmf - Enconding error when using POIFSChunkParser on Linux
Status: RESOLVED FIXED
Product: POI
Classification: Unclassified
Component: POIFS
3.5-dev
PC Linux
: P2 critical (vote)
: ---
Assigned To: POI Developers List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2009-05-11 01:38 UTC by BUREAU Nicolas
Modified: 2009-05-16 12:12 UTC (History)
0 users



Attachments
changes to StringChunk class (1.17 KB, patch)
2009-05-11 01:38 UTC, BUREAU Nicolas
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description BUREAU Nicolas 2009-05-11 01:38:25 UTC
Created attachment 23638 [details]
changes to StringChunk class

Changes to the StringChunk class

This applies to the hsmf component in the scratchpad area.

The setValue method in StringChunk class uses default platform encoding to convert stream parameter into String. This conversion doesn't work when the OS is Linux.

The solution was to test chunk type and set encoding used to convert the Stream to String :
  - if type is "NEW_STRING" (indeed Unicode) : we set encoding to "UTF16-LE"
  - if type is "OLD_STRING" : we set encoding to "CP1252"
Comment 1 Nick Burch 2009-05-16 12:12:28 UTC
Thanks for this. Applied to svn with a few tweaks.