JS-& # Unicode; encoding conversion
<MCE: Script Type = "text/JavaScript"> <! -- <Br/> var tohtml = {<br/> On: function (STR) {<br/> var A = [], <br/> I = 0; <br/> for (; I <Str. length;) A [I] = Str. charcodeat (I ++); <br/> return "& #" +. join ("; & #") + ";" <br/>}, <br/> UN: function (STR) {<br/> return Str. replace (/& # (x )? ([^ &] {1, 5 });? /G, <br/> function (a, B, c) {<br/> return string. fromcharcode (parseint (C, B? 16: 10) <br/>}< br/>}; <br/> alert (tohtml. on ("/" Please enter/""); <br/> alert (tohtml. UN (""); <br/> // --> </MCE: SCRIPT> <br/>
JS-unicode encoding and conversion
<MCE: Script Type = "text/JavaScript"> <! -- <Br/> var Toun = {<br/> On: function (STR) {<br/> var A = [], <br/> I = 0; <br/> for (; I <Str. length;) A [I] = ("00" + Str. charcodeat (I ++ ). tostring (16 )). slice (-4); <br/> return "// U" +. join ("// U") <br/>}, <br/> UN: function (STR) {<br/> return Unescape (Str. replace (// G, "%") <br/>}< br/>}; <br/> alert (Toun. on ("/" Please enter/""); <br/> alert (Toun. UN ("// u0022 // u8bf7 // u8f93 // u0022"); <br/> // --> </MCE: SCRIPT> <br/>