poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ryan Ackley" <sack...@cfl.rr.com>
Subject Re: Platform dependent encoding (problems running on linux)
Date Mon, 03 Nov 2003 14:09:50 GMT
Not only different, but also different lengths. To me, that points to
different files or some type of corruption when you transferred the files.

I don't think its an encoding problem. The bytes are actually different. If
you use the same encoding on two different platforms with the same bytes and
you don't get the same results that would be a bug in Java not POI. You see,
Java was invented to prevent that problem

Ryan

----- Original Message ----- 
From: "Morten" <lists@kikobu.com>
To: <poi-user@jakarta.apache.org>
Sent: Monday, November 03, 2003 8:41 AM
Subject: Platform dependent encoding (problems running on linux)


>
> 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