I have issues opening a series of .xml files on MacOS with an utf-16 encoding header that were forwarded to me.
The preamble of all these files is clean, with encoding="utf-16". MS Excel cannot open them, and text editors such as emacs and TextEdit display strange foreign characters. However, RStudio and Xcode open them properly. I can open the files with one of them and manually set the encoding to 'utf-8'. Once this is done, they are parsed properly with Excel and text editors as well.
Interestingly, once they are labeled as 'utf-8', I can open them in emacs, manually edit the encoding back to 'utf-16', save them, and after that they open correctly, but labeled as 'utf-16'. I suspect that this is a problem with how these files were generated in the first place, but I am puzzled.