File: C:/xampp/htdocs/cmykDe/ut8b5.php
<textarea cols="20" rows="5" id="str">
</textarea><p/>
<input type="button" value="�ഫ" onclick="javascript: encode(str,this);" />
<script>
var charset="big5";
function encode(content,btn){
if(charset=="big5"){
content.value=content.value.replace(/[^\u0000-\u00FF]/g,function($0){return escape($0).replace(/(%u)(\w{4})/g,"&#x$2;")});
btn.value="�٭�";
charset="utf8";
}else{
content.value=unescape(content.value.replace(/&#x/g,'%u').replace(/;/g,''));
btn.value="�ഫ";
charset="big5";
}
}
</script>