always use unicode in memory while using .NET.

解决方案 »

  1.   

    谢谢,guag(天知道)string str = "中国";
    看内存内容,是以unicode编码方式存储的
    但是调用:
    byte[] bt1 = Encoding.Default.GetBytes(str);
    bt1中却是以ANSII编码方式存储,也就是Default是ANSII编码
    奇怪VS为什么不统一处理?好麻烦
      

  2.   

    因为bt1不是string,他就是个byte[],随便存任何用户想要的逐个字节的东西。而string就是微软规定的string,不是用户随便修改的。
      

  3.   

    Encoding.Default
    是GB13000编码
    如何设置,才可以使Encoding.Default默认为unicode编码