[求助]如何将UTF-8编码转换为gb2312编码

yllaji 2003-05-08 10:49:46
如何将UTF-8编码转换为gb2312编码

其实是这样的

如果 IE设置的 只用 UTF-8 发送网的话

如 http://名字.xxxx.com 用 request("server_name")
就会变成 鍚嶅瓧.xxxx.com
如果 不 只用 UTF-8 发送就正常 名字.xxxx.com

问题:
如何 在用户不改变 ie设置的情况下 将 UTF-8 的编码 转换 为 gb2312的编码呢?

将 鍚嶅瓧.xxxx.com 转换为 名字.xxxx.com
...全文
58 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
yllaji 2003-05-09
  • 打赏
  • 举报
回复
不是吧!!
yllaji 2003-05-09
  • 打赏
  • 举报
回复
救命
yllaji 2003-05-08
  • 打赏
  • 举报
回复
help 在线等~~~
yllaji 2003-05-08
  • 打赏
  • 举报
回复
又变成 %E5%90%8D%E5%AD%97.xxxx.com 了

什么时候能变成 名字.xxxx.com 啊……
yllaji 2003-05-08
  • 打赏
  • 举报
回复
又变成 %E5%90%8D%E5%AD%97.yaolei.com 了

什么时候能变成 名字.xxxx.com 啊……
foolljfool 2003-05-08
  • 打赏
  • 举报
回复
'编码转换
function urlencoding(vstrin)
dim i,strreturn
strreturn = ""
for i = 1 to len(vstrin)
thischr = mid(vstrin,i,1)
if abs(asc(thischr)) < &hff then
strreturn = strreturn & thischr
else
innercode = asc(thischr)
if innercode < 0 then
innercode = innercode + &h10000
end if
hight8 = (innercode and &hff00)\ &hff
low8 = innercode and &hff
strreturn = strreturn & "%" & hex(hight8) & "%" & hex(low8)
end if
next
urlencoding = strreturn
end function
yllaji 2003-05-08
  • 打赏
  • 举报
回复
foolljfool 大哥……

鍚嶅瓧.xxxx.com 变成

Z搮]鐃. xxxx.com 了

还是没变成 名字.xxxx.com 啊……
foolljfool 2003-05-08
  • 打赏
  • 举报
回复
'编码转换
function bytes2BSTR(vIn)
dim strReturn,i,ThisCharCode,innerCode,Hight8,Low8,NextCharCode
strReturn=""
for i=1 to LenB(vIn)
ThisCharCode=AscB(MidB(vIn,i,1))
if ThisCharCode<&H80 Then
strReturn=strReturn & Chr(ThisCharCode)
else
NextCharCode=AscB(MidB(vIn,i+1,1))
strReturn=strReturn&Chr(CLng(ThisCharCode)*&H100+CInt(NextCharCode))
i=i+1
end if
next
bytes2BSTR=strReturn
end function
yllaji 2003-05-08
  • 打赏
  • 举报
回复
求助! 在线等~~
yllaji 2003-05-08
  • 打赏
  • 举报
回复
真的假的 这个问题很难吗?
zhenbe 2003-05-08
  • 打赏
  • 举报
回复
up

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧