go ahead... be a heretic | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
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 :-) In reply to Data Dumper utf8 utf-8 unicode by smartnut007
|
|