in reply to Re^2: Encoding horridness revisited: What's going on here?
in thread Encoding horridness revisited: What's going on here? [SOLVED]
Can you trust your terminal emulator to properly handle the output?
To me, encoding issues are always a wild goose chase, so I like to eliminate as many things from the encoding dance as quickly as possible. Usually that means that instead of including umlauts (or whatever) in my source code, I use the character names instead:
# instead of use utf8; my $s = "göre";
# I prefer to use use charnames; my $s = "g\N{LATIN SMALL LETTER O WITH DIAERESIS}re";
This eliminates the issue that my text editor is lying to me.
When inspecting the output, I either pipe the output through hexdump or through Data::Dumper with $Data::Dumper::Useqq =1; so the console only sees 7bit ASCII.
This eliminates my terminal emulator lying to me.
Of course, that does not help with reading data from files that I don't control, but every little step helps.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Encoding horridness revisited: What's going on here?
by karlgoethebier (Abbot) on Jul 13, 2017 at 14:23 UTC |