Click here to Skip to main content
15,899,754 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,

I have to convert xml in utf-16 format to utf-8 format.

Can anyone help me please.....
Posted

I would say - Open the xml file in Visual Studio and Go to File > Advanced Save Options and select Unicode (UTF-8).

If this solution doesn't work for you then see the following links:

http://social.msdn.microsoft.com/forums/en-US/sqlxml/thread/16917908-9172-4654-a8da-e8c0da66246b/[^]

http://www.ibm.com/developerworks/xml/library/x-utf8/[^]

http://stackoverflow.com/questions/750449/converting-xml-from-utf-16-to-utf-8-using-powershell[^]

http://xmlfox.com/convert_utf.htm[^]

Hope it helps...
 
Share this answer
 
Comments
DexterS2 21-Jun-12 23:26pm    
Thanks..I will try this.
Hi,

I tried in the following way but still results coming up in utf-16



strXML1-- Converted my xml to string.

var utf8String = Encoding.UTF8.GetBytes(strXML1);
string utf8str = BitConverter.ToString(utf8String);
string final = Encoding.UTF8.GetString(utf8String);

can anyone rectify it ?

Thanks
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900