Public Scratchpad | Download, Select Code To D/L |
This little program works fine to convert a UTF-16 file to UTF-8:
But when I try to do what I think is the same thing from the command line:#! perl use encoding "utf16", STDOUT => "utf8"; while (<>) { print }
The resulting file is a whacked semi-utf-16 format.perl -Mencoding=utf16,STDOUT,utf8 -p -e 1 < in > out