There's more than one way to do things | |
PerlMonks |
Data Dumper utf8 utf-8 unicodeby smartnut007 (Initiate) |
on Apr 23, 2009 at 00:24 UTC ( [id://759457]=perlquestion: print w/replies, xml ) | Need Help?? |
smartnut007 has asked for the wisdom of the Perl Monks concerning the following question:
use utf8; use Data::Dumper; use Encode; open(my $f ,">:encoding(utf-8)", "C:/tmp/utf8.txt"); binmode $f,':encoding(utf-8)'; print $f "Log Started \n "; END{ close($f); }; my $str = '原來' print $f $str."\n"; print $f Dumper( $str ); print "\n"; print $f decode_utf8( Dumper( encode_utf8( $str ) ); The output is Log Started 原 來 $VAR1 = '原來'; My question is how do i get Data::Dumper to handle utf8 strings and not produce ISO-latin-1 encoded utf-8 characters like x{....} ps: forgive my formatting . Cant get perlmonks.org to handle utf-8 very well either :-)
Back to
Seekers of Perl Wisdom
|
|