function cjkEncode(text) { if (text == null) { return ""; } var newText = ""; for (var i = 0; i < text.length; i++) { var code = text.charCodeAt (i); if (code >= 128 || code == 91 || code == 93) {//91 is "[", 93 is "]". newText += "[" + code.toString(16) + "]"; } else { newText += text.charAt(i); } } return newText; } 这是个转码的js函数,请高手根据实现原理给个java的实现过程,谢谢了! |
0
|
|
|||
0
|
|
|||
0
|
|
|||
0
|
|
|||
0
|
|
|||
0
|
|
|||
0
|
|
|||
0
|
|
|||
0
|
|
|||
0
|
|