管理员
var data = "zhe里填  写$%#(*字符";
var b = '';
for (var i = 0; i < data.length; i++) {
    var a = data[i].charCodeAt().toString(16);
    if (a.length < 4) {
        for (var j = a.length; j < 4; j++) {
            a = "0" + a;
        }
    } 
    b = b+"\\u"+a;
}
alert(b);
最后由 DcrClub 编辑