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

":utf8" not propagated in dup filehandle

Thread Next
From:
Daniel Ruoso
Date:
March 23, 2007 09:41
Subject:
":utf8" not propagated in dup filehandle
Message ID:
1174668084.4286.29.camel@localhost
Hi,

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,
':utf8').

So, this is the code to show the problem:

<code>
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;
</code>

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)...

daniel


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About