Opening utf-16 xml files in Visual Studio 2005
Posted on 2009-05-20
If I edit the following xml file in Vistual Studio 2005 (File -> Open -> File...), it shows me nothing as the Error List tab contains the following error:
Error 1 Invalid token 'Text' at root level of document. C:\Users\rich\Downloads\sample.xml 1 1 Miscellaneous Files
Here's the simple xml file.
<?xml version="1.0" encoding="utf-16"?>
Changing the xml file to be utf-8 as follows:
<?xml version="1.0" encoding="utf-8"?>
allows VS to open the file correctly.
Why is this? Please note that I am getting this xml file from a third party, so it's not really possible to change the utf-16 to utf-8 in practice.