1. 程式人生 > >保存xml報錯 'UTF_8' is not a supported encoding name

保存xml報錯 'UTF_8' is not a supported encoding name

see def cep lar info provider supported utf 保存xml

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