I used iconv to convert the file from UTF-16LE (little known, as I found out by trial and error), which was created by TextPad on Windows in ASCII on OSX as follows:
cat utf16file.txt |iconv -f UTF-16LE -t ASCII > asciifile.txt
You can broadcast via hexdump, as well as view the characters and make sure that you get the correct output, the terminal knows how to interpret UTF-16 and displays it correctly, so you canβt just say, but do βcatβ, from the file:
cat utf16file.txt | iconv -f UTF-16LE -t ASCII | hexdump -C
This shows a layout with hexadecimal char codes and ASCII characters on the right side, and you can try different encodings in the -f "from" parameter to find out what you are dealing with.
Use the iconv -l icon to display the character sets that iconv can use on your system.
source share