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.

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__
Output:
$ perl 1182603.pl $VAR1 = "Nach R\x{fc}cksprache mit"; $VAR1 = 'Nach Rücksprache mit';
(But as others have said, Data::Dumper is not usually the best choice for data serialization or generating final program output.)

Hope this helps!


The way forward always starts with a minimal test.