in reply to Is there some universal Unicode+UTF8 switch?
1) String literals in the source code. Solution: put use utf8 on top of all your files.
2) Files/sockets that you open (or that are opened for you, like STDIN). Solution: binmode, or open my $fh, '<:encoding(utf-8)', $name.
3) Various system messages, errors and the like, such as $! (as in open my $fh, '<', $name or die $!. The $! gives you the output of C's strerror(), a string that contains who-knows-what in unspecified encoding... Once upon a time perl liked to double encode such things but I think it doesn't anymore?
4) Modules, written by other people. This is the real problem. There is no solution. You need to read the documentation (or the source code) and do the right thing.
Thus, there is no super-switch. It would be good if there was, but there isn't. utf8:all helps with the first 3 problems, but it doesn't do anything with the 4th. Use Devel::Peek for debugging, unfortunately, that's still the best thing there is.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Is there some universal Unicode+UTF8 switch?
by haj (Vicar) on Sep 02, 2019 at 09:01 UTC | |
|
Re^2: Is there some universal Unicode+UTF8 switch?
by VK (Novice) on Sep 02, 2019 at 09:49 UTC | |
by daxim (Curate) on Sep 02, 2019 at 11:02 UTC | |
by VK (Novice) on Sep 02, 2019 at 11:21 UTC | |
by daxim (Curate) on Sep 02, 2019 at 12:19 UTC | |
by VK (Novice) on Sep 02, 2019 at 14:00 UTC | |
| |
by haj (Vicar) on Sep 02, 2019 at 12:08 UTC | |
by Anonymous Monk on Sep 02, 2019 at 10:25 UTC | |
by VK (Novice) on Sep 02, 2019 at 11:05 UTC | |
by haj (Vicar) on Sep 02, 2019 at 12:17 UTC | |
by VK (Novice) on Sep 02, 2019 at 12:46 UTC | |
|