How can I tell Perl that its standard/file input is, say, UTF-16,
without also having it also try to interpret its code as UTF-16?
Things I thought of:
1. Is there any way via -m/-M to specify the equivalent of this use decl?
use encoding UTF-8, STDIN => UTF-16LE, STDOUT => UTF-16LE;
2. Alternatively, will something like this work?
perl -e 'BEGIN { open ARGV, '<:encoding(UTF-16LE)', <&ARGV; } ... '
Any other suggestions?
--
Mark J. Reed <markjreed@gmail.com>
Thread Next