utf-8转换gb2312问题
在写asp网页时,获得一个值赋给参数 Subject,页面定义为gb2312,使用response.write Subject,页面显示出现乱码,如下:“銆婂井杞妧鏈腑蹇冨懆浜旇鍧涖€嬭绋”。
如果使用UTF-8查看,则可以正常显示汉字。请问,在获取这个值的时候,要经过怎么处理,才能在gb2312的页面中正常显示?有使用了如下函数转换:
function UTF2GB(UTFStr)
for Dig=1 to len(UTFStr)
if mid(UTFStr,Dig,1)="%" then
if len(UTFStr) >= Dig+8 then
GBStr=GBStr & ConvChinese(mid(UTFStr,Dig,9))
Dig=Dig+8
else
GBStr=GBStr & mid(UTFStr,Dig,1)
end if
else
GBStr=GBStr & mid(UTFStr,Dig,1)
end if
next
UTF2GB=GBStr
end function
但是这句“if mid(UTFStr,Dig,1)="%" then”无法执行进去,应该是没有“%”的原因。
请问,该怎么处理?