07-11
08

GB2312与UTF-8之间转码后的文字乱码问题

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
改为UTF-8,页面文字出现乱码,解决方案:
引用内容 引用内容
UTF-8与GB2312互转方法


第一步:修改 commond.asp 文件,将文件的前4行,也就是 '定义 Cookie,Application 域 前面的代码用以下代码替换:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
Option Explicit
Response.Buffer = True
Server.ScriptTimeOut = 90
Session.CodePage=936


参考的是:
如果制作的网页脚本与WEB服务端的默认代码页不同,则必须指明代码页:
codepage=936 简体中文GBK
codepage=950 繁体中文BIG5
codepage=437 美国/加拿大英语
codepage=932 日文
codepage=949 韩文
codepage=866 俄文
codepage=65001 unicode UFT-8

第二步:把所有的


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


改成


<meta http-equiv="Content-Type" content="text/html; charset=GB2312" />


再另存为ANSI


GB2312转换为UTF-8编码的方法

第一步:
修改 commond.asp 文件,将文件的前4行,也就是 '定义 Cookie,Application 域 前面的代码用以下代码替换:

程序代码:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
Option Explicit
Response.Buffer=True
Session.CodePage=65001
Server.ScriptTimeOut = 90


然后修改 header.asp 和 admincp.asp 还有 attachment.asp 文件 找到:

程序代码:

<meta http-equiv="Content-Type" content="text/html; charset=GB2312" />


修改为:

程序代码:

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


第二步:
将BLOG的所有ASP和JS文件,用记事本打开,然后另存为,编码本来是默认, 选择成UTF-8就可以了
</textarea></div></div><script language="javascript" type="text/javascript">initUBB("Message")</script></td>
             </tr>
                                 <tr>
               <td align="right" valign="top"> </td>
                <td colspan="2" align="left"><label for="label4">
               <label for="label4"><input id="label4" name="log_disImg" type="checkbox" value="1" />
   禁止显示图片</label>
                 <label for="label5">
                 <input name="log_DisSM" type="checkbox" id="label5" value="1" />
   禁止表情转换</label>
                 <label for="label6">
                 <input name="log_DisURL" type="checkbox" id="label6" value="1" />
   禁止自动转换链接</label>
                <label for="label7">
                 <input name="log_DisKey" type="checkbox" id="label7" value="1" />
   禁止自动转换关键字</label></td>
             </tr>
           <tr>
               <td  align="right" valign="top"><span style="font-weight: bold">内容摘要:</span></td>
               <td colspan="2" align="left"><div><label for="shC"><input id="shC" name="log_IntroC" type="checkbox" value="1" onclick="document.getElementById('Div_Intro').style.display=(this.checked)?'block':'none'" />编辑内容摘要</label></div>
               <div id="Div_Intro" style="display:none">
              
                <textarea name="log_Intro" class="editTextarea" style="width:99%;height:120px;"><meta http-equiv="Content-Type" content="text/html; charset=gb2312">
改为UTF-8,页面文字出现乱码,解决方案:
引用内容 引用内容
UTF-8与GB2312互转方法


第一步:修改 commond.asp 文件,将文件的前4行,也就是 '定义 Cookie,Application 域 前面的代码用以下代码替换:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%


文章来自: 本站原创
引用通告: 查看所有引用 | 我要引用此文章
Tags: 转码 乱码
相关日志:
评论: 0 | 引用: 0 | 查看次数: 1215
发表评论
昵 称:
密 码: 游客发言不需要密码.
内 容:
验证码: 验证码
选 项:
虽然发表评论不用注册,但是为了保护您的发言权,建议您注册帐号.
字数限制 1000 字 | UBB代码 开启 | [img]标签 关闭