ASP常用函数收藏乱七八糟未整理版(81)
' 函数原型:Bytes2BSTR (v)
'功能:UTF-8编码转换到正常的GB2312
'参数:vUTF-8编码字节流
'返 回 值:解码后的字符串
'涉及的表:无
'===================================================================================
Public Function Bytes2BSTR(v)
Dim r, i, t, n
r = ""
For i = 1 To LenB(v)
t = AscB(MidB(v, i, 1))
If t < &H80 Then
r = r & Chr(t)
Else
n = AscB(MidB(v, i + 1, 1))
r = r & Chr(CLng(t) * &H100 + CInt(n))
i = i + 1
End If
Next
Bytes2BSTR = r
End Function
%>
内容版权声明:除非注明,否则皆为本站原创文章。