一个关于编码的问题
using System;
public class code
{
public static void Main()
{
string strTemp = "abcdefg 某某某";
int i = System.Text.Encoding.Default.GetBytes(strTemp).Length;
int j = strTemp.Length;
System.Console.WriteLine(System.Text.Encoding.Default.BodyName);
System.Console.WriteLine(i);
System.Console.WriteLine(j);
}
}
我这里的运行结果:
gb2312
11 //对这个结果不解,知道的解释一下,汉字不是2个字节编码?
11