May-20-2018, 10:24 AM
In linux, you have iconv:
Output:iconv --from-code=UTF-8 --to-code=UTF-16 < input.txt > output.txt
It uses the C function iconv fron libiconv so writting your tiny wrapper in C around it shall not be a big issue.