javascript base64编码解码(汉字正常,但文件较大)

1.UnicodeAnsi.js

 

 

 

2.base64.htm

 

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>base64</title>
<script src="UnicodeAnsi.js" language="javascript"></script>
</head>

<body>

<script language = "javascript">


</script>


<form method="POST" action="--WEBBOT-SELF--">
<table border="1" width="100%" style="border-collapse: collapse">
    <tr>
        <td><textarea rows="20" name="S1" cols="57"></textarea></td>
        <td><input type="button" value="base64decode--&gt;" name="B1" onclick="S2.value=strAnsi2Unicode(decode64(S1.value));"><br><br>
        <input type="button" value="unescape--&gt;" name="B2" onclick="S1.value=unescape(S2.value)">
        <input type="button" value="&lt;--base64encode" name="B2" onclick="S1.value=encode64(strUnicode2Ansi(S2.value))"></td>
        <td><textarea rows="20" name="S2" cols="56"></textarea></td>
    </tr>
    <tr>
        <td> </td>
        <td> </td>
        <td> </td>
    </tr>
</table>


</form>
</body>

</html>

阅读更多

更多精彩内容