gpt4 book ai didi

mysql - 使用ASP和MySQL设置字符集

转载 作者:行者123 更新时间:2023-11-30 23:47:41 26 4
gpt4 key购买 nike

有人知道如何解决这个问题吗?
文本显示为:“摘要”。

我在ASP中有一个网页,该网页从MySQL获取数据,数据库和表均设置为utf-8默认值,并且我的网页是使用utf8编码的,没有bom并具有以下代码

<%@Language="VBScript" CodePage = 65001%>
<%
Response.ContentType = "text/html"
Response.AddHeader "Content-Type", "text/html; charset=utf-8"
Response.AddHeader "Pragma", "no-cache"
response.Charset="utf-8"
Response.CodePage = 65001
Session.LCID = 2070
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR...nsitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pt" lang="pt">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>


有任何想法吗?
谢谢

编辑:顺便说一句,我从此页面中的数据库获取的其他数据很好用,仅从该表无法正常工作,并且iv已经检查并且所有表都相同。

最佳答案

请将asp页面另存为“带有Bom的utf8”

去掉

CodePage = 65001
Response.AddHeader "Content-Type", "text/html; charset=iso-8859-1"
response.Charset="iso-8859-1"
Response.CodePage = 65001
Session.LCID = 2070




<meta http-equiv="content-type" content="text/html;charset=UTF-8">

关于mysql - 使用ASP和MySQL设置字符集,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29795538/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com