develooper Front page | perl.perl5.porters | Postings from March 2007

":utf8" not propagated in dup filehandle

Thread Next
Daniel Ruoso
March 23, 2007 09:41
":utf8" not propagated in dup filehandle
Message ID:

I've been talking about this in #p5p, but nobody could say for sure if
this is really a bug or not. I do think, however, that the effects of
this behaviour do appear like bugs (Just try to use a string with UTF8
characters in Test::Simple ok method if you had set binmode STDOUT,

So, this is the code to show the problem:

binmode STDOUT, ':utf8';
open TESTOUT, '>&STDOUT' or die 'cant dup STDOUT.'.$!;
my $message = 'Some string with special characters!!! áéíóúãĩ­!!!'.$/;
print STDOUT $message;
print TESTOUT $message;
binmode TESTOUT, ':utf8';
print TESTOUT $message;

I've dig a little in the code, but I really couln't figure out anything
(ok, it was my first travel in the code)...


Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About