Sometimes the Unicode had to be transcoding, so we had to code it manually. Yesterday on the Internet to see a unitcode transcoding method, very easy to use! Small knitting to share it with you.
JavaScript script Unicode transcoding function:
<script type= "Text/javascript" >
var gb2312unicodeconverter = {
tounicode:function (str) {
return Escape (str). toLocaleLowerCase (). Replace (/%u/gi, ' \\u ');
}
, Togb2312:function (str) {return
unescape ( Str.replace (/\\u/gi, '%u '));
}
;
var str = ' Shanghai ', Unicode;
document.write (str + ' <br/> ');
Unicode = Gb2312unicodeconverter.tounicode (str);
document.write (' Kanji Conversion to Unicode code: ' + Unicode + ' <br/><br/> ');
document.write (' Unicode code conversion to Chinese characters: ' + gb2312unicodeconverter.togb2312 (Unicode));
</script>
This is a very good writing transcoding tool, you can organize it into a common programming tool, when needed directly to use!