string str = "测试123+-";
int test1 = str.Length;//长度为7 字符长度:不管中文、英文、符号都是一个字符
int test2 = System.Text.Encoding.Default.GetByteCount(str);//长度为9 字节长度:中文占两个字节,其他占一个字节
int test3 = System.Text.Encoding.UTF8.GetByteCount(str);//长度为11 utf-8字节长度:中文占三个字节,其他占一个字节