中英文字符串长度计算方法:
<html>
<body>
<mce:script type="text/javascript"><!--
var Str = '中国123';
var escStr = escape(Str);
var numI = 0;
var escStrlen = escStr.length;
for (i = 0; i < escStrlen; i++)
if (escStr.charAt(i) == '%')
if (escStr.charAt(++i) == 'u')
numI++;
document.write(Str.length + numI);
// --></mce:script>
</body>
</html>
引:http://hi.baidu.com/wely_ton/blog/item/bf5a21136419be5af819b858.html