Bug 47179

Summary: [PATCH] hsmf - Enconding error when using POIFSChunkParser on Linux
Product: POI Reporter: BUREAU Nicolas <nicolas.b27>
Component: POIFSAssignee: POI Developers List <dev>
Severity: critical    
Priority: P2    
Version: 3.5-dev   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Attachments: changes to StringChunk class

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.