Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Perl Beginners > Changing case o...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 4 Topic 10936 of 11982
Post > Topic >>

Changing case of UTF-8 strings

by pauloantonio73@[EMAIL PROTECTED] (Paulo Antonio) Apr 14, 2008 at 07:10 AM

Hi all,

I'm trying to change case of UTF-8 strings. I've read a bunch of
do***entation, but can't figure out how to do it right. Here is an
example:

=3D=3D=3D My code:
use strict;
use utf8;

my $line;
my $letter;

while ($line =3D <STDIN>) {
    chomp($line);
    utf8::upgrade($line);
    $line =3D lc($line);
    print "${line}\n";
}
=3D=3D=3D Data file:
ANDR=C3=89 DA SILVA
=C3=82NGELO DE SOUZA
=3D=3D=3D Execution (perl 5.8.8):
$ ./lower.pl < names > output
=3D=3D=3D Output
andr=EF=BF=BD=EF=BF=BD da silva
=EF=BF=BD=EF=BF=BDngelo de souza
=3D=3D=3D

As you may notice, I managed to change the special character into
something. But not the corresponding lower case UTF-8 letter. Please
help.
 




 4 Posts in Topic:
Changing case of UTF-8 strings
pauloantonio73@[EMAIL PRO  2008-04-14 07:10:10 
Re: Changing case of UTF-8 strings
chas.owens@[EMAIL PROTECT  2008-04-14 12:25:53 
Re: Changing case of UTF-8 strings
pauloantonio73@[EMAIL PRO  2008-04-14 10:21:06 
Re: Changing case of UTF-8 strings
chas.owens@[EMAIL PROTECT  2008-04-15 09:41:41 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Oct 11 1:50:44 CDT 2008.