<html> <input type=“button” id=“btnf” onClick=“filt()” value=“提交”> <br> <input type=“text” id=“syntext” size=“70”> <script>
function filt() {
var subtext=document.getElementById("syntext").value, unicode; unicode = GB2312UnicodeConverter.ToUnicode(subtext); document.getElementById("syntext").value=unicode;
}
var GB2312UnicodeConverter = { ToUnicode: function (str) { return escape(str).toLocaleLowerCase().replace(/%u/gi, '\\u'); } , ToGB2312: function (str) { return unescape(str.replace(/\\u/gi, '%u')); } };
</script> </html>