我想把一串16进制机内码转成字符串显示,我需要VB.NET程序.
1个回答
展开全部
不知道你是什么编码,我查了“1港”的编码是这样:
Dim a() As Byte
Dim b As String
a = {&H31, &HE6, &HB8, &HAF} 'UTF-8编码
b = System.Text.Encoding.UTF8.GetString(a)
MsgBox(b)
a = {&H31, 0, &H2F, &H6E} 'Unicode编码
b = System.Text.Encoding.Unicode.GetString(a)
MsgBox(b)
Dim a() As Byte
Dim b As String
a = {&H31, &HE6, &HB8, &HAF} 'UTF-8编码
b = System.Text.Encoding.UTF8.GetString(a)
MsgBox(b)
a = {&H31, 0, &H2F, &H6E} 'Unicode编码
b = System.Text.Encoding.Unicode.GetString(a)
MsgBox(b)
更多追问追答
追问
asc("港")=B8DB
我得到数据也是这样 如何转换?
追答
和asc对应的函数是chr:
Dim a As Integer = &HB8DB
MsgBox(Chr(a))
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询