<andrew@pimlott.ne.mediaone.net> writes: >This is a bug report for perl from andrew@pimlott.ne.mediaone.net, >generated with the help of perlbug 1.26 running under perl 5.00503. > > >----------------------------------------------------------------- >[Please enter your report here] > >I'm trying to understand Perl's traditional locale support, and finding it >frustratingly inconsistent. I created the following program > >#!/usr/bin/perl > >use locale; >use POSIX; >$c1 = chr 0xc0; >$c2 = tolower $c1; >$c3 = lc $c1; >__END__ > >and ran it in the debugger with LANG=en_US. The transcript is at the end, >but in short, tolower always returns the same character, Because you have not called POSIX's setlocale() (I am not 100% sure we support it.) >and lc works as >expected in the program, but not on the debugger command line. If I recall correctly use locale; is lexically scoped, and debugger is in a different scope. >PS. This message is in ISO-8859-1; the character 0xc0 is "LATIN CAPITAL >LETTER A WITH GRAVE", and 0xe0 is "LATIN SMALL LETTER A WITH GRAVE". > >% LANG=en_US perl -d ./try2 It is also far from uncommon for 'en_US' locales to claim that they are ASCII only - (and that true Americans don't need no nasty pinko accented characters ;-)) But as your C program works that seems not to be the problem. -- Nick Ing-SimmonsThread Previous | Thread Next