asp utf8到gb2312

来源:互联网 发布:移动广告数据 编辑:程序博客网 时间:2024/05/17 07:20

 if Len(city)>0 then
    x = gb2utf8(city)
    if x<>"" then
        city = x
    end if
end if
Function gb2utf8(s)
    Dim byt
    Set byt = CreateObject("ADODB.Stream")
    byt.Type = 2   
    byt.CharSet = "GB2312"
    byt.Open
    byt.WriteText s
    byt.Position = 0
    byt.CharSet = "UTF-8"
    gb2utf8 = byt.ReadText
    byt.Close   
    Set byt = Nothing
End Function

原创粉丝点击