惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Schneier on Security
Security Archives - TechRepublic
Security Archives - TechRepublic
T
Threat Research - Cisco Blogs
G
GRAHAM CLULEY
P
Privacy & Cybersecurity Law Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
Cisco Talos Blog
Cisco Talos Blog
The Hacker News
The Hacker News
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Cyber Attacks, Cyber Crime and Cyber Security
Security Latest
Security Latest
Know Your Adversary
Know Your Adversary
P
Palo Alto Networks Blog
C
Cisco Blogs
AWS News Blog
AWS News Blog
T
Threatpost
L
LINUX DO - 热门话题
Simon Willison's Weblog
Simon Willison's Weblog
Scott Helme
Scott Helme
C
Cybersecurity and Infrastructure Security Agency CISA
T
Tor Project blog
Cyberwarzone
Cyberwarzone
P
Proofpoint News Feed
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
The Exploit Database - CXSecurity.com
The Register - Security
The Register - Security
D
Darknet – Hacking Tools, Hacker News & Cyber Security
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
罗磊的独立博客
云风的 BLOG
云风的 BLOG
V
Vulnerabilities – Threatpost
N
News | PayPal Newsroom
Project Zero
Project Zero
NISL@THU
NISL@THU
博客园_首页
MyScale Blog
MyScale Blog
V2EX - 技术
V2EX - 技术
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
F
Full Disclosure
T
Troy Hunt's Blog
Recorded Future
Recorded Future
N
Netflix TechBlog - Medium
P
Privacy International News Feed
H
Hackread – Cybersecurity News, Data Breaches, AI and More
A
Arctic Wolf
C
Check Point Blog
W
WeLiveSecurity
Apple Machine Learning Research
Apple Machine Learning Research
C
CERT Recently Published Vulnerability Notes

博客园 - 小小小程序员

转载 gridview在绑定显示的各种格式 - 小小小程序员 - 博客园 转 ASP.NET 2.0中OWC生成柱状图和饼状图的源代码 - 小小小程序员 转 ASP.NET 页面事件执行顺序 转 用 Javascript 验证表单(form)中的单选(radio)值 转 .net里如何判断中文字符长度 转CSDN Sybase PowerDesigner专区 转 ASP.net中的Server.UrlEncode函数和ASP中的Server.URLEncode函数返回的值竟然不一样!!!! DIV实现下拉菜单 转 .NET 2.0 SqlDependency快速上手指南 转 SqlServer 2005 报表批量自动部署 使用XMLHTTP 获取服务器数据,实现无刷新效果 转 SQL Server 2005中设置Reporting Services发布web报表的匿名访问 div 属性 OBJECTPROPERTY函数使用 转 数字金额大小写转换之存储过程 转 PowerDesigner教程系列 [转载]ASP.NET 格式化字符串 转 VS.NE类、变量、文件命名规范 转 MVC在Web系统中的模式与应用
同一个ASP站点UTF-8和GB2312的两个子站点乱码的解决方法
小小小程序员 · 2009-03-27 · via 博客园 - 小小小程序员

ASP程序在同一个站点中,如果出现UTF-8编码的程序,又有GB2312的程序,在浏览完UTF-8编码的页面后,再浏览GB2312的页面,GB2312编码的页面就会出现乱码.

出现这样的问题,可能是:当你浏览UTF-8编码的时候,服务器默认用UTF-8的引擎来输出html,当你用再浏览GB2312的页面时,它还是用UTF-8来输出本应是GB2312编码的页面.所以会乱码.

如果要将他们转为同一种编码可能会很痛苦.

还有一种解决方法是:不用作任何转换,保持原来的编码不变.在Utf-8程序的第一行加上:

CODE: 

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%Session.CodePage=65001%>


在GB2312程序的第一行加上

CODE: 

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%Session.CodePage=936%>

这样就可以了.当然如果你的所有程序都在第一行include 一个文件的话,把上面的代码放在被include 的文件第一行就马上解决问题了.
Session.CodePage是指定服务器用哪种编辑来输出.有了它的声明,服务器就不会用默认的编码引擎来输出了.

同一个ASP站点UTF-8和GB2312的两个子站点乱码的解决方法