poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Avik Sengupta <a...@apache.org>
Subject Re: Platform dependent encoding (problems running on linux)
Date Mon, 03 Nov 2003 13:49:45 GMT
Hi, 

First up, which version are you using? SSTRecord and associated have
changed quite a bit over the last few versions, particularly with
respect to double byte char handling. 

Also, check the default encoding in your platform/shell. That sometimes
messes up stuff (it shouldnt, this is only a workaround to a bug..). in
RedHat 8 for eg, default encoding is UTF-8. Change it to ISO8859-1 (LANG
env), and see if it helps. Check what is the encoding in windows (i dont
know how .... I think there is a java system property that can tell
you)....

In summary, I suspect that your problem may be solved by upgrading, or,
as a workaround, by setting the proper default encoding. 

HTH
-
Avik


On Mon, 2003-11-03 at 19:11, Morten wrote:
> Hi. I've been developing an application for extracting data
> from Excel documents and inserting into a DB. When the application
> runs on windows, it works fine. Just now, I've moved to to Linux,
> and this appears to break the encoding. I'm curious if anyone
> here has had similar experiences.
> 
> The string value in the below, is from SSTRecord.getString(int i);
> The UTB-8 byte[] is a byte-per-byte dump of the byte[] obtained
> by SSTRecord.getString(int i).getBytes("UTF-8");
> 
> Log from windows:
> 
> 14:32:33.213 03/11/2003 DEBUG: Processing record (31,1): Leer más
> 14:32:33.213 03/11/2003 DEBUG:   - deflt byte[]: 
> 76,101,101,114,32,109,-31,115
> 14:32:33.213 03/11/2003 DEBUG:   - UTF8  byte[]: 
> 76,101,101,114,32,109,-61,-95,115
> 14:32:33.213 03/11/2003 DEBUG:   - UTF16 byte[]: 
> -2,-1,0,76,0,101,0,101,0,114,0,32,0,109,0,-31,0,115
> 
> Log from linux:
> 
> 14:32:15.861 03/11/2003 DEBUG: Processing record (31,1): Leer m�
> 14:32:15.861 03/11/2003 DEBUG:   - deflt byte[]: 
> 76,101,101,114,32,109,-17,-65,-67
> 14:32:15.861 03/11/2003 DEBUG:   - UTF8  byte[]: 
> 76,101,101,114,32,109,-17,-65,-67
> 14:32:15.861 03/11/2003 DEBUG:   - UTF16 byte[]: 
> -2,-1,0,76,0,101,0,101,0,114,0,32,0,109,-1,-3
> 
> As you can see, the byte[]'s are different from platform to platform. :-|
> 
> Any tips greatly appreciated.
> 
> Thanks,
> 
> Morten
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: poi-user-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org


Mime
View raw message