So,
is the correct patch something like changing these lines?
Can anyone validate this and if its ok include it in the module for a
future release?
Line 68 of FmtDefault.pm:
------------------------
#return pack('C*', unpack('n*', $sTxt));
return pack('U*', unpack('n*', $sTxt));
Lines 1789,1790 of ParseExcel.pm:
-----------------------------------
#substr($sWk, 3, 1) &= pack('c', unpack("c",substr($sWk, 3, 1)) & 0xFC);
#substr($lWk, 0, 1) &= pack('c', unpack("c",substr($lWk, 0, 1)) & 0xFC);
# changed accordingly with
http://rt.cpan.org/Public/Bug/Display.html?id=7376
substr($sWk, 3, 1) &= pack('C', unpack("C",substr($sWk, 3, 1)) & 0xFC);
substr($lWk, 0, 1) &= pack('C', unpack("C",substr($lWk, 0, 1)) & 0xFC);
Regards,
Sergio Freire
On Fri Aug 12 11:02:31 2005, guest wrote:
Show quoted text> [guest - Fri Jul 15 14:58:51 2005]:
>
> > > [ Change unpack("C*",... to unpack("U*",...
> > Nice. I wonder what side-effects this has.
>
> It seems to me that Excel encodes extended characters in UTF-8, so this
> will correctly parse extended characters into a Unicode string. (I
> noticed this with several characters, suprisingly including the Euro
> symbol.) This could potentially mess up calling code which is
> expecting a string containing ASCII characters, but it seems fine in
> the context of the module itself.
>
> > I get a couple of other similar warnings:
> >
> > Character in 'c' format wrapped in pack at
> > /usr/lib/perl5/vendor_perl/5.8.6/Spreadsheet/ParseExcel.pm line 1790.
> > Character in 'c' format wrapped in pack at
> > /usr/lib/perl5/vendor_perl/5.8.6/Spreadsheet/ParseExcel.pm line 1789.
>
> These warnings are because the module is trying to mask off the last
> two bits of a character by unpacking it to a *signed* number and then
> masking 0xFC and then repacking it as a singed number. But, the & 0xFC
> operation seems to remove the sign. So, I made this change to those
> two lines:
> < substr($sWk, 3, 1) &= pack('c', unpack("c",substr($sWk, 3,
> 1)) & 0xFC);
> > substr($sWk, 3, 1) &= pack('C', unpack("C",substr($sWk, 3,
> 1)) & 0xFC);
>
> < substr($lWk, 0, 1) &= pack('c', unpack("c",substr($lWk, 0,
> 1)) & 0xFC);
> > substr($lWk, 0, 1) &= pack('C', unpack("C",substr($lWk, 0,
> 1)) & 0xFC);
>
>
> which does the same operation, but uses an unsigned integer.
>