DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15492>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15492

Add a method to set the encoding when reading a spreadsheet

           Summary: Add a method to set the encoding when reading a
                    spreadsheet
           Product: POI
           Version: 1.5.1
          Platform: Sun
        OS/Version: Solaris
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: HSSF
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


When POI reads a spreadsheet, it uses the operating system's default character 
encoding to process the data.  This presents a problem when reading UTF-8 
characters on a platform that defaults to a different encoding.  It would be 
useful to provide a way to set the encoding.

The code that processes the data is at line 156 of 
poi/hssf/record/UnicodeString.java.  I replaced
            field_3_string = new String(data, 3, getCharCount());
with
            try
            {
                field_3_string = 
                    new String(data, 3, getCharCount(), "ISO-8859-1");
            }
            catch(Exception ex)
            {
                field_3_string = new String(data, 3, getCharCount());
            }

to read my spreadsheet.  A method to set the encoding would be wondeful.

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to