develooper Front page | perl.perl5.porters | Postings from April 2003

Re: [perl #21874] Perl bug involving $1 and lc()

Thread Previous | Thread Next
From:
Robert Spier
Date:
April 8, 2003 16:33
Subject:
Re: [perl #21874] Perl bug involving $1 and lc()
Message ID:
3E9300FE.9090108@pobox.com
Jon Rifkin (via RT) wrote
> Note the second output line, where there should be a '12345' there is
> instead a '0c0'.  This problem occurrs regardless of the input
> data unless the are blank lines, and the error always occurs on
> the second output line starting at the second column.

Weird--

   I see you're using RH8.  This looks like a UTF8 Locale issue.  RedHat 
8 changed the default encoding to utf8.

  I can easily replicate this on my RH7.3 box when explicitly setting LANG.

  echo 0123456789 0123456789 | LANG=en_US.utf8 perl -lne 'print lc($1) 
while /(\d+)/g'
0123456789
00c06789

I believe this is smarter in perl5.8.1-to-be and 5.9.1-to-be.

-R




Thread Previous | Thread Next


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