You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Villu Roogna <re...@gmail.com> on 2006/06/11 12:44:23 UTC

perlio questions

Hello,

I am wondering why following does not work as expected
File encoding is in iso-8859-1


my $str = "äää";
binmode(OUT, ":utf8");
print OUT $str;

Expected result: string is output in utf.
Real result: string is still in iso-8859-1

When I write it like this

use Encode;

my $str = "äää";
Encode::from_to($str, "iso-8859-1", "utf8");
print OUT $str;

everything works as expected, that is $str is output in utf.

All the best,
Phade