保存xml报错 'UTF_8' is not a supported encoding name

Posted kingbook

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了保存xml报错 'UTF_8' is not a supported encoding name相关的知识,希望对你有一定的参考价值。

ArgumentException: ‘UTF_8‘ is not a supported encoding name. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method.
var doc=new XmlDocument();
XmlDeclaration declaration = doc.CreateXmlDeclaration("1.0","UTF_8",null);//unity 2018.3.0f2 改为 UTF-8
doc.AppendChild(declaration);

以上是关于保存xml报错 'UTF_8' is not a supported encoding name的主要内容,如果未能解决你的问题,请参考以下文章

sql报错Illegal mix of collations

sql报错Illegal mix of collations

XML报文头必须是<?xml version='1.0' encoding='UTF-8'?>这种格式么???

Django加载模版报错 'utf8' codec can't decode byte

python3 报错:UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd6 in position 201: inv

Python保存数据到文件的方法