develooper Front page | perl.perl5.porters | Postings from February 2001

Re: [ID 20010225.003] inconsistencies in locale support

Thread Previous | Thread Next
From:
nick
Date:
February 25, 2001 14:38
Subject:
Re: [ID 20010225.003] inconsistencies in locale support
Message ID:
E14X9kY-0004BJ-00@roam1
<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-Simmons


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