perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Rhinelander <>
Subject Re: mp2: utf-8 and uc() under modperl2
Date Fri, 26 May 2006 21:56:17 GMT
Gunnar Koppel wrote:
> Terr!
> I have little problem with UTF-8 under modperl2. I made such little
> script for testing:
> -------
> #!/usr/bin/perl
> use strict;
> use locale;
> use utf8;
> binmode stdin, ":utf8";
> binmode stdout, ":utf8";
> my @alpha = qw(a b c d e f g h i j k l m n o p q r s š z ž t u v õ ä ö ü
> x y);
> print "Content-Type: text/plain; charset=UTF-8\n\n";
> print "LC_CTYPE: $lc\n";
> print "\u$_ " foreach @alpha;
> print "\n";
> -------

The script as above doesn't work out of the box -- the '$lc' variable
isn't defined.  Commenting out that line, I got the same results as you
and eventually figured it out to be a problem with using 'stdout'
instead of 'STDOUT' in your binmode() calls.  Changing the binmode from:

binmode stdout, ":utf8";


binmode STDOUT, ":utf8";

makes it work properly.  This seems to me like a bug, but perhaps
someone more familiar with mod_perl's STDOUT tying than I can explain
this (or confirm this as a bug).

-- Jason Rhinelander

View raw message