| 发表于:2007-03-23 10:43:50 楼主 |
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 |
|
|
|
|