asp实现二进制字符串转换为Unicode字符串

2019-04-02 06:40:17刘景俊
若需要utf-8格式,请自行将下面的GB2312改成utf-8。

' 二进制转字符串,否则会出现乱码的! 
Function sTb(vin)
        Const adTypeText = 2
        Dim BytesStream,StringReturn
        Set BytesStream = Server.CreateObject("ADODB.Stream")
 With BytesStream
       .Type = adTypeText
       .Open
       .WriteText vin
       .Position = 0
       .Charset = "GB2312"
       .Position = 2
        StringReturn = .ReadText
       .Close
   End With
Set BytesStream = Nothing
sTb = StringReturn
End Function 

您可能感兴趣的文章:

C#将Unicode编码转换为汉字字符串的简单方法python 转换 Javascript %u 字符串为python unicode的代码golang实现unicode转换为字符串string的方法JavaScript中字符串与Unicode编码互相转换的实现方法JavaScript字符串对象fromCharCode方法入门实例(用于把Unicode值转换为字符串)Java String字符串和Unicode字符相互转换代码解决无法在unicode和非unicode字符串数据类型之间转换的方法详解JS 文字符串转换unicode编码函数js字符串与Unicode编码互相转换