标签:style blog color io ar sp div on cti
unicode和gbk的互相转换主要依靠window下的escape和unescape方法,然后把%u替换成\u就好了;
var GB2312UnicodeConverter = { ToUnicode: function (str) { return escape(str).toLocaleLowerCase().replace(/%u/gi, ‘\\u‘); } , ToGB2312: function (str) { return unescape(str.replace(/\\u/gi, ‘%u‘)); } };
easy to understand!~.~
标签:style blog color io ar sp div on cti
原文地址:http://www.cnblogs.com/diligenceday/p/4042582.html