in reply to convert encoding
Hi rumpeumpel1,
Character encoding is complicated. You might like to look at a very simple overview I posted previously.
As other monks have pointed out, Data::Dumper will not do what you want. If you replace it with Data::Dumper::AutoEncode and use eDumper instead of Dumper, your encoding will be retained.
Output:use strict; use warnings; use feature 'say'; use Data::Dumper::AutoEncode; use utf8; my $str = 'Nach Rücksprache mit'; say Dumper $str; say eDumper $str; __END__
(But as others have said, Data::Dumper is not usually the best choice for data serialization or generating final program output.)$ perl 1182603.pl $VAR1 = "Nach R\x{fc}cksprache mit"; $VAR1 = 'Nach Rücksprache mit';
Hope this helps!
|
|---|