var doc = ho_ifSubmit.document;
doc.open();
doc.write('<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head><body>');
// your html code
doc.write('</body></html>');
// submit
doc.open();
doc.write('<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head><body>');
// your html code
doc.write('</body></html>');
// submit
其他的没条件测试 哈
用ho_ifSubmit.document.forms(0).p_rows(0).value="中文"进行赋值,插入到数据库的不会出现乱码。
如果用ho_ifSubmit.document.writeln('<input type=text name=p_rows value="中文">');就会出现乱码。
不知该如何解决?我希望看到用apache服务器的解决办法。
我曾使用escape函数:ho_ifSubmit.document.writeln
('<input type=text name=p_rows value="'+escape(中文)+'">');
服务器端接收到的信息其它语言不知道应该如何解码?
你用的是什么浏览器?仔细看了一下你的代码,结果还是产生新页了。于是这个问题就不是问题了!
1、无论是document.writeln还是document.write,在document关闭的情况下(页面加载加载完毕)执行时都会产生新页,而新页的charset默认为unicode(utf-8),这样表单将以utf-8编码提交,自然就在gb2312环境下产生“乱码”了
2、按你的做法是需要设置页面语言的
如何解决这个乱码问题?
http://blog.ydqmx.net/more.asp?name=%CF%A6%CB%AE&id=184