From: Nicholas Clark
Date: 15:01 on 01 Aug 2006
Subject: Spreadsheet::ParseExcel
return pack('C*', unpack('n*', $sTxt));
No. That's not a valid way to convert ucs2 text to anything, let alone
ISO-8859-1
Urge
To
Kill
Rising
[It's converting network order 16 bit values into a list of numbers, then
converting that list to 8 bit characters, with an implicit truncation]
Nicholas Clark
From: Jeremy Stephens
Date: 17:20 on 01 Aug 2006
Subject: Re: Spreadsheet::ParseExcel
Nicholas Clark wrote:
> return pack('C*', unpack('n*', $sTxt));
>
> No. That's not a valid way to convert ucs2 text to anything, let alone
> ISO-8859-1
>
> Urge
> To
> Kill
> Rising
>
> [It's converting network order 16 bit values into a list of numbers, then
> converting that list to 8 bit characters, with an implicit truncation]
>
> Nicholas Clark
>
>
I ran into problems with UCS2 a couple weeks ago. I exported some data
from MS SQL into a CSV file, which I then read from a scripting language
(R, a statistical language) to do some stuff. R doesn't know how to
read UCS2, which is hateful (since there's a Windows binary of it, you
would think it would know how). Anyway, I ended up just doing the
conversion with vim (using the fenc option), since it was a one-shot deal.
That isn't really all that relevant to your hate, but I feel your pain
nonetheless.
Jeremy
From: Sean Conner Date: 18:34 on 01 Aug 2006 Subject: Re: Spreadsheet::ParseExcel It was thus said that the Great Jeremy Stephens once stated: > > I ran into problems with UCS2 a couple weeks ago. I exported some data > from MS SQL into a CSV file, which I then read from a scripting language > (R, a statistical language) to do some stuff. R doesn't know how to > read UCS2, which is hateful (since there's a Windows binary of it, you > would think it would know how). Anyway, I ended up just doing the > conversion with vim (using the fenc option), since it was a one-shot deal. You didn't have iconv installed? [1] -spc (iconv isn't all that hateful either [2]) [1] Is useful information here allowed? Forgive me if it isn't. [2] So I guess I really need to beg for forgiveness then.
From: Sean Conner
Date: 18:31 on 01 Aug 2006
Subject: Re: Spreadsheet::ParseExcel
It was thus said that the Great Nicholas Clark once stated:
> return pack('C*', unpack('n*', $sTxt));
>
> No. That's not a valid way to convert ucs2 text to anything, let alone
> ISO-8859-1
"But ... but ... but ... it works for me!" [1]
-spc ("We don't need to steeeking accented letters!")
[1] Probably a programmer using US-ASCII only.
Generated at 10:26 on 16 Apr 2008 by mariachi