【发布时间】:2014-02-19 14:37:23
【问题描述】:
我需要从 iso-8859-2 页面读取内容并在我的代码中以 UTF-8 写入。
代码示例:
<%@ language="VBSCRIPT" codepage="65001" %>
<%
set xmlhttp=Server.CreateObject("Msxml2.XMLHttp.6.0")
Set re=New RegExp
re.IgnoreCase=True
re.Global=True
xmlhttp.open "get", link, false
xmlhttp.setRequestHeader "Content-type", "application/x-www-form-urlencoded; charset=ISO-8859-2"
xmlhttp.send()
html=xmlhttp.responsetext
re.Pattern="<h1>.*?</h1>"
set aux=re.execute(html)
text = aux(0)
response.write text
%>
原点原文:
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" >
<h1>Novo público no interior</h1>
今天在 utf-8 页面上的输出:
"Novo pï¿¿o no interior"
我需要在 UTF-8 上正确输出文本。谁能帮帮我?
【问题讨论】:
-
对不起,这不是一个真正的答案,但每次我必须谷歌字符串编码时,我都会遇到这篇文章,阅读它,解决我的问题,然后通常一周后就忘记了。 joelonsoftware.com/articles/Unicode.html
标签: encoding utf-8 vbscript asp-classic xmlhttprequest