https://bz.apache.org/bugzilla/show_bug.cgi?id=60289

            Bug ID: 60289
           Summary: UTF decoding XSSFRichTextString does not work when the
                    code is lowercase
           Product: POI
           Version: 3.15-FINAL
          Hardware: PC
                OS: All
            Status: NEW
          Severity: trivial
          Priority: P2
         Component: XSSF
          Assignee: dev@poi.apache.org
          Reporter: dgon...@gmail.com

Created attachment 34397
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=34397&action=edit
Microsoft Access Database to reproduce the bug

Hi,

The class XSSFRichTextString decodes the UTF strings that OOXML format stores
in the XML that it generates, this works as expected when the file is generated
from Excel as it generates the code with an uupercase hex value, eg: _x000D_
will get translated to /r. 

But I have found that when you export from Microsoft Access 2010 (I haven't
tested in newer versions) through a Visual Basic macro using the method
DoCmd.TransferSpreadsheet
(https://msdn.microsoft.com/en-us/library/office/ff844793.aspx) with the type
acSpreadsheetTypeExcel12Xml to export to OOXML it generates the UTF characters
with the values in lowercase, eg: _x000d_ wich are not matched by the regular
expression used in XSSFRichTextString and thus get passed to the value
unmodified.

That's not a problem if the value is stored back to an xslx file, as Excel
understand it and decodes the character, but in my case we copy this value to a
CSV file which causes the code _x000d_ to be transferred to the text file and
not the expected /r. Similar results can be seen if you output the
XSSFRichTextString value to a log.

Attached is a simple Access Database with one table that has one rich text
field that contains the character /r and a Visual Basic module that exports the
contents of the tables to Excel, I have also included the Excel that results
from executing the macro.

Regards,
Daniel.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org

Reply via email to