必须将utf 16的xml编码转换为utf8 [英] Have to convert xml encoding utf 16 to utf8

查看:195
本文介绍了必须将utf 16的xml编码转换为utf8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我必须将utf-16格式的xml转换为utf-8格式.

谁能帮我.高级保存选项,然后选择Unicode(UTF-8).

如果该解决方案对您不起作用,请查看以下链接:

http://social.msdn.microsoft.com /forums/zh-CN/sqlxml/thread/16917908-9172-4654-a8da-e8c0da66246b/ [ http://www.ibm.com/developerworks/xml/library/x-utf8/ [^ ]

http://stackoverflow.com/questions/750449/将xml-from-utf-16-to-utf-8-using-powershell [ http://xmlfox.com/convert_utf.htm [ 解决方案

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...


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


这篇关于必须将utf 16的xml编码转换为utf8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆