Syntactic Confectionery Delight | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Perhaps it will help to systematize things a bit. Text can come to your program from various sources:
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.In reply to Re: Is there some universal Unicode+UTF8 switch?
by Anonymous Monk
|
|