remove encoding="utf-16" before deserialize
This commit is contained in:
parent
c9dddd2f1f
commit
f25b2828ca
@ -28,9 +28,10 @@ namespace Volian.Base.Library
|
||||
public static T StringDeserialize(string s)
|
||||
{
|
||||
T t;
|
||||
string ss = s.Replace("encoding=\"utf-16\"", "");
|
||||
XmlSerializer xs = new XmlSerializer(typeof(T));
|
||||
UTF8Encoding enc = new UTF8Encoding();
|
||||
Byte[] arrBytData = enc.GetBytes(s);
|
||||
Byte[] arrBytData = enc.GetBytes(ss);
|
||||
using (MemoryStream ms = new MemoryStream(arrBytData))
|
||||
{
|
||||
t = (T)xs.Deserialize(ms);
|
||||
|
Loading…
x
Reference in New Issue
Block a user