On Apr 14, 2008, at 10:10, Paulo Antonio wrote:
Hi all, I'm trying to change case of UTF-8 strings. I've read a bunch of documentation, but can't figure out how to do it right. Here is an example: === My code: use strict; use utf8; my $line; my $letter; while ($line = <STDIN>) { chomp($line); utf8::upgrade($line); $line = lc($line); print "${line}\n"; } === Data file: ANDRÉ DA SILVA ÂNGELO DE SOUZA === Execution (perl 5.8.8): $ ./lower.pl < names > output === Output andr�� da silva ��ngelo de souza === As you may notice, I managed to change the special character into something. But not the corresponding lower case UTF-8 letter. Please help.
Hmm, the following works for me, but then again I have export PERL_UNICODE=SDL #Make Perl use UTF-8 for IO in my .bash_profile. #!/usr/bin/perl use strict; use warnings; use utf8; while (my $line = <DATA>) { print $line; chomp($line); $line = lc $line; print "$line\n"; } __DATA__ ANDRÉ DA SILVA ÂNGELO DE SOUZA -- Chas. Owens wonkden.net The most important skill a programmer can have is the ability to read. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/