I frequenty run into problems with utf-8 in perl, and I was wondering
if anyone else
had encountered similar things.

One thing I've noticed is that when processing characters, I often get
warnings about
"wide characters in print", or have input/output get horribly mangled.

Ive been trying to work around it in various ways, commonly doing thing such as:
binmode STDIN,":utf8";
binmode STDOUT,":utf8";

or using functions such as :
sub unfunge_string
{
   foreach my $ref (@_)
   {
       $$ref = Encode::decode("utf8",$$ref,Encode::FB_CROAK);
   }
}


but this feels wrong to me.

For a language that really goes out of its way to support encodings, I
wonder if it
wouldnt have been better off it it just ignored the entire concept
alltogether and treated
strings as arrays of bytes...

Ive found pages wherin people complain of similar problems, such as:
http://ahinea.com/en/tech/perl-unicode-struggle.html

And I'm wondering if in its attempt to be a good i18n citizen, perl
hasnt gone overboard and made a mess of things instead.

--
Linux-UTF8:   i18n of Linux on all levels
Archive:      http://mail.nl.linux.org/linux-utf8/

Reply via email to