perl-unicode

Re: unicode backwards compatibility bugged?

2003-05-03 02:30:05
On Sat, May 03, 2003 at 07:39:38AM +0100, Adam Back wrote:
So I have a simple perl script (which coincidentally implements the
RC4 cipher).

So if you do "man perlunicode" it says your pre 5.6 scripts should
basically work as is.

However I'm finding in practice the simplest concievable example
doesn't work, viz:

% perl --version
This is perl, v5.8.0 built for i386-linux-thread-multi
[...]
% perl -e 'print chr(255)' | od -tx1
0000000 c3 bf

which is plain wrong!  It should output ff.

The same happens for any byte over 127.

So then there is the bytes pragma which is supposed to force
everything to bytes, which also seems plain broken, viz:

% perl -e 'use bytes; print chr(255)' | od -tx1
0000000 c3 bf

Let me guess: you are using RedHat?

WTF?

Am I misunderstanding something about this "transparent" unicode, or
did all the perl scripts on the planet that used binary data just stop
working?

Adam

-- 
Jarkko Hietaniemi <jhi(_at_)iki(_dot_)fi> http://www.iki.fi/jhi/ "There is this 
special
biologist word we use for 'stable'.  It is 'dead'." -- Jack Cohen

<Prev in Thread] Current Thread [Next in Thread>