1、表单项目1 GBK编码格式
用户采集单是GBK编码,通过GET/POST提交上来的数据也是GBK格式,无需做任何处理
测试源码
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="GB2312"> </head> <body> <li><a href="gbkForm.html" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >GBK同编码表单不乱码</a> <li><a href="utf8Form.html" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >UTF8表单修改前乱码</a> <li><a href="utf8FormRepair.html" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >UTF8表单修改为AJAX方案后不乱码</a> <li><a href="otherForm.html" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >其他GBK同编码表单不乱码</a> <li><a href="http://www.miaoqiyuan.cn/p/utf8-submit-gbk-ajax-autocharset" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >测试程序说明</a></a> <hr /> <h2>GET:</h2> <form action="gbkSubmit.asp" method="GET" > QQ:<input name="qq" value="QQ" /><br /> 姓名:<input name="name" value="姓名"/><br /> 地址:<input name="address" value="地址地址地址"/><br /> <button type="submit">GBK表单提交到GBK脚本后不会乱码</button> </form> <h2>POST:</h2> <form action="gbkSubmit.asp" method="POST" > QQ:<input name="qq" value="QQ" /><br /> 姓名:<input name="name" value="姓名"/><br /> 地址:<input name="address" value="地址地址地址"/><br /> <button type="submit">GBK表单提交到GBK脚本后不会乱码</button> </form> </body> </html>
2、表单项目2 UTF8编码格式(可以在不同的域名下)
用户采集单是UTF8编码,通过GET/POST提交上来的数据也是UTF8格式,用表单项目1中的程序接收到的是乱码
测试代码(修改前,提交乱码):
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF8"> </head> <body> <li><a href="gbkForm.html" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >GBK同编码表单不乱码</a> <li><a href="utf8Form.html" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >UTF8表单修改前乱码</a> <li><a href="utf8FormRepair.html" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >UTF8表单修改为AJAX方案后不乱码</a> <li><a href="otherForm.html" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >其他GBK同编码表单不乱码</a> <li><a href="http://www.miaoqiyuan.cn/p/utf8-submit-gbk-ajax-autocharset" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >测试程序说明</a></a> <hr /> <h2>GET:</h2> <form action="gbkSubmit.asp" method="GET" > QQ:<input name="qq" value="QQ" /><br /> 姓名:<input name="name" value="姓名"/><br /> 地址:<input name="address" value="地址地址地址"/><br /> <button type="submit">UTF8表单提交到GBK脚本后会乱码</button> </form> <h2>POST:</h2> <form action="gbkSubmit.asp" method="POST" > QQ:<input name="qq" value="QQ" /><br /> 姓名:<input name="name" value="姓名"/><br /> 地址:<input name="address" value="地址地址地址"/><br /> <button type="submit">UTF8表单提交到GBK脚本后会乱码</button> </form> </body> </html>
不需要改变页面编码,只需要修改表单Action地址,增加name=”ConvertCallBack” value=”ProjectA/FormGBK”、name=”ConvertItems” value=”name,qq,bb” 的两个 input即可,不用对页面进行其他调整
编码设置,转换器自动操作。
<form action="convert/utf8.asp"... <input name="ConvertCallBack" value="ProjectA/FormGBK"> <input name="ConvertItems" value="name,qq,address"/> <!-- 根据表单实际情况,修改表单项目 -->
测试代码(修改后)
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF8"> </head> <body> <li><a href="gbkForm.html" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >GBK同编码表单不乱码</a> <li><a href="utf8Form.html" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >UTF8表单修改前乱码</a> <li><a href="utf8FormRepair.html" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >UTF8表单修改为AJAX方案后不乱码</a> <li><a href="otherForm.html" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >其他GBK同编码表单不乱码</a> <li><a href="http://www.miaoqiyuan.cn/p/utf8-submit-gbk-ajax-autocharset" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >测试程序说明</a></a> <hr /> <h2>GET:</h2> <form action="convert/utf8.asp" method="GET" > QQ:<input name="qq" value="QQ" /><br /> 姓名:<input name="name" value="姓名"/><br /> 地址:<input name="address" value="地址地址地址"/><br /> <input name="ConvertCallBack" value="../gbkSubmit.asp" /> <input name="ConvertItems" value="name,qq,address" /> <button type="submit">AJAX转码方案</button> </form> <h2>POST:</h2> <form action="convert/utf8.asp" method="POST" > QQ:<input name="qq" value="QQ" /><br /> 姓名:<input name="name" value="姓名"/><br /> 地址:<input name="address" value="地址地址地址"/><br /> <input name="ConvertCallBack" value="../gbkSubmit.asp" /> <input name="ConvertItems" value="name,qq,address" /> <button type="submit">AJAX转码方案</button> </form> </body> </html>
3、表单项目3 GBK编码格式(可以在不同的域名下)
没有任何影响,只要按照表单1的标准编写 参数即可
测试代码:
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="GB2312"> </head> <body> <li><a href="gbkForm.html" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >GBK同编码表单不乱码</a> <li><a href="utf8Form.html" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >UTF8表单修改前乱码</a> <li><a href="utf8FormRepair.html" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >UTF8表单修改为AJAX方案后不乱码</a> <li><a href="otherForm.html" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >其他GBK同编码表单不乱码</a> <li><a href="http://www.miaoqiyuan.cn/p/utf8-submit-gbk-ajax-autocharset" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >测试程序说明</a></a> <hr /> <h2>GET:</h2> <form action="gbkSubmit.asp" method="GET" > QQ:<input name="qq" value="QQ" /><br /> 姓名:<input name="name" value="姓名"/><br /> 地址:<input name="address" value="地址地址地址"/><br /> Other1:<input name="other1" value="Other1"/><br /> Other2:<input name="other2" value="Other2"/><br /> Other3:<input name="other3" value="Other3"/><br /> Other4:<input name="other4" value="Other4"/><br /> Other5:<input name="other5" value="Other5"/><br /> Other6:<input name="other6" value="Other6"/><br /> Other7:<input name="other7" value="Other7"/><br /> Other8:<input name="other8" value="Other8"/><br /> Other9:<input name="other9" value="Other9"/><br /> <button type="submit">GBK表单提交到GBK脚本后不会乱码</button> </form> <h2>POST:</h2> <form action="gbkSubmit.asp" method="POST" > QQ:<input name="qq" value="QQ" /><br /> 姓名:<input name="name" value="姓名"/><br /> 地址:<input name="address" value="地址地址地址"/><br /> Other1:<input name="other1" value="Other1"/><br /> Other2:<input name="other2" value="Other2"/><br /> Other3:<input name="other3" value="Other3"/><br /> Other4:<input name="other4" value="Other4"/><br /> Other5:<input name="other5" value="Other5"/><br /> Other6:<input name="other6" value="Other6"/><br /> Other7:<input name="other7" value="Other7"/><br /> Other8:<input name="other8" value="Other8"/><br /> Other9:<input name="other9" value="Other9"/><br /> <button type="submit">GBK表单提交到GBK脚本后不会乱码</button> </form> </body> </html>
全部测试包下载地址 anycharset_jb51.rar
utf8.asp
<% @codepage=936 %> <% CallBack = Server.Htmlencode(Request("ConvertCallBack")) Items = Split(Request("ConvertItems"),",") if len(request.form) > 0 then method = "POST" else method = "GET" end if %><!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="GB2312"> <script src="/UploadFiles/2021-04-02/jquery.js">utf8_convert.asp
<% @codepage=65001 %> <% function NotXSS(html) NotXSS = html NotXSS = replace(NotXSS, "<", "<") NotXSS = replace(NotXSS, ">", ">") NotXSS = replace(NotXSS, """", ""e;") end function '防止参数冲突,使用了 MiaoQiYuanAutoConvertItem Response.Write NotXSS(Request(Request.QueryString("MiaoQiYuanAutoConvertItem"))) %>
华山资源网 Design By www.eoogi.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
华山资源网 Design By www.eoogi.com
暂无评论...
更新日志
2024年11月20日
2024年11月20日
- 柏菲·珞叔作品集《金色大厅2》限量开盘母带ORMCD[低速原抓WAV+CUE]
- Gareth.T《sad songs(Explicit)》[320K/MP3][29.03MB]
- Gareth.T《sad songs(Explicit)》[FLAC/分轨][152.85MB]
- 证声音乐图书馆《海风摇曳·盛夏爵士曲》[320K/MP3][63.06MB]
- 龚玥《金装龚玥HQCD》头版限量[WAV分轨]
- 李小春《吻别》萨克斯演奏经典[原抓WAV+CUE]
- 齐秦《辉煌30年24K珍藏版》2CD[WAV+CUE]
- 证声音乐图书馆《海风摇曳·盛夏爵士曲》[FLAC/分轨][321.47MB]
- 群星 《世界经典汽车音乐》 [WAV分轨][1G]
- 冷漠.2011 《冷漠的爱DSD》[WAV+CUE][1.2G]
- 陈明《流金岁月精逊【中唱】【WAV+CUE】
- 群星《Jazz-Ladies1-2爵士女伶1-2》HQCD/2CD[原抓WAV+CUE]
- 群星《美女私房歌》(黑胶)[WAV分轨]
- 郑源.2009《试音天碟》24BIT-96KHZ[WAV+CUE][1.2G]
- 飞利浦试音碟 《环球群星监听录》SACD香港版[WAV+CUE][1.1G]