Smal html file which helps in UNICODE encoding.

This commit is contained in:
trifonnt 2007-05-05 21:31:08 +00:00
parent c3eb997ab4
commit 5ee7668131
1 changed files with 42 additions and 0 deletions

42
utils_dev/trl/encode.html Normal file
View File

@ -0,0 +1,42 @@
<html><head><title>js escape()/unescape() function</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"></head><body>
<pre>JavaScript escape()/unescape() function test
</pre>
<form name="encode">
<textarea rows="10" cols="60" name="src"></textarea>
<input onclick="utfEncode();" value="encode" type="button">
<textarea rows="10" cols="60" name="dest"></textarea>
<input onclick="utfDecode();" value="decode" type="button">
</form>
<script language="JavaScript">
function utfEncode(){
var str = document.encode.src.value;
str=escape(str)
str=str.replace(/%/g, "\\");
str=str.toLowerCase();
document.encode.dest.value=str;
}
function utfDecode(){
var str = document.encode.dest.value
str=str.replace(/\\/g, "%");
document.encode.src.value
=unescape(str);
}
</script>
</body></html>