Re: Help with uc and lc and utf8

[email protected] (Dan Kogai)
Newsgroups perl.unicode
Message-ID <[email protected]>
On Nov 06, 2004, at 15:21, Robert D Oden wrote:
> I am not able to lower case a Ä. I am sure I am missing something 
> simple but I have spent many hours researching and trying different 
> things to no avail.
>
> Any help would be appreciated!!

Make sure:

* You have saved your script in UTF-8, not Latin1
* use utf8 to make sure string literals are treated as UTF-8 strings
* if you print, set filehandle layer to ":utf8".

Try the sript below (be sure to save it in UTF-8).  I got "KÄThe => 
käthe".

#
use strict;
use utf8;
my $fname = 'KÄThe';
my $lc_fname = lc($fname);
binmode STDOUT => ":utf8";
print "$fname => $lc_fname\n";
__END__

> Summary of my perl5 (revision 5.0 version 8 subversion 0) 
> configuration:

You should upgrade it to 5.8.1 or above (5.8.5 being the latest).  
5.8.0 was still premature unicode-wise.

Dan the Encode Maintainer
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.