zoukankan      html  css  js  c++  java
  • C# XmlSerializer UTF-16

                using (System.IO.MemoryStream ms = new System.IO.MemoryStream())
                {
                    using (System.IO.StreamWriter writer = new System.IO.StreamWriter(ms, Encoding.GetEncoding("UTF-16")))
                    {
                        new System.Xml.Serialization.XmlSerializer(typeof(ViewProcess)).Serialize(writer, vp);
                        string s = Encoding.GetEncoding("UTF-16").GetString(ms.ToArray());
                        System.Diagnostics.Debug.Print(s);
                    }
                }
    
                    using (System.IO.MemoryStream ms = new System.IO.MemoryStream(System.Text.Encoding.GetEncoding("UTF-16").GetBytes(s)))
                    {
                        if (new System.Xml.Serialization.XmlSerializer(typeof(ViewProcess)).Deserialize(ms) is ViewProcess vp)
                        {
                            
                        }
                    }
    
  • 相关阅读:
    vue 中使用阿里iconfont彩色图标
    团队作业九
    团队作业八
    团队作业七
    第二篇
    第三篇
    第一篇
    beta冲刺计划安排
    团队作业六
    团队作业五
  • 原文地址:https://www.cnblogs.com/honk/p/14810019.html
Copyright © 2011-2022 走看看