develooper Front page | perl.perl5.porters | Postings from March 2007

Re: [perl #42102] perlbug AutoReply: unpack use internal string representation (utf8)

From:
Alex Efros
Date:
March 29, 2007 03:16
Subject:
Re: [perl #42102] perlbug AutoReply: unpack use internal string representation (utf8)
Message ID:
20070329040519.GB30892@home.power
Hi!

Here is additional information from JSON::XS author:

> Your perl is broken, 'n' works correctly on any current version:
> 
>    perl -e '$s1 = $s = "\xAA\xBB\xCC"; utf8::upgrade $s1; die map {sprintf "%x",$_} unpack "n", $s1'
>    aabb at -e line 1.
> 
>    This is perl, v5.8.8 built for amd64-linux
> 
>    /opt/bleedperl/bin/perl5.9.5 -e '$s1 = $s = "\xAA\xBB\xCC"; utf8::upgrade $s1; die map {sprintf "%x", $_} unpack "n", $s'
>    aabb at -e line 1.
> 
>    This is perl, v5.9.5 DEVEL29192 built for amd64-linux

My result of that command really show it's 'my perl broken':

$ perl -e '$s1 = $s = "\xAA\xBB\xCC"; utf8::upgrade $s1; die map {sprintf
"%x", $_} unpack "n", $s1'
c2aa at -e line 1.

This is perl, v5.8.8 built for i686-linux

I'm using Gentoo Linux, so it's actually dev-lang/perl-5.8.8-r2 Gentoo
package, which add some patches to perl, but looks like they all related
to compilation phase and can't broke anything related to core perl.

-- 
			WBR, Alex.



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About