显示在网页地址栏的中文怎么才能转换啊?
时间:2011-09-15
来源:互联网
在一个地址栏里的“%D3%CE%CF%B7”这个字符,表示中文“游戏”,那我应该如何把“游戏”这个词通过VB转换成“%D3%CE%CF%B7”呢,还有其他中文又是该如何转换呢?谢谢!
作者: penguinhzf 发布时间: 2011-09-15
参阅这个:
VB code
D3 CE是 游 的区位码。至于%号,那可能是各个字节之间的分割而已。
VB code
ption Explicit Private Sub Command1_Click() Dim bArr() As Byte Dim strByte() As String Dim sMe As String Dim intP As Integer If Text2.Text = "" Then Exit Sub strByte = Split(Text2.Text) For intP = LBound(strByte) To UBound(strByte) strByte(intP) = CStr(Val("&H" & strByte(intP))) Next intP ReDim bArr(UBound(strByte) - LBound(strByte) + 1) For intP = LBound(strByte) To UBound(strByte) bArr(intP) = Val(strByte(intP)) Next intP sMe = StrConv(bArr, vbUnicode) Text1.Text = sMe End Sub Private Sub Command2_Click() Dim intP As Integer Dim uniByte() As Byte If Text1.Text = "" Then Exit Sub uniByte = StrConv(Text1.Text, vbFromUnicode) Text2.Text = "" For intP = LBound(uniByte) To UBound(uniByte) Text2.Text = Text2.Text & Right("00" & Hex(uniByte(intP)), 2) & " " Next intP Text2.Text = Left(Text2.Text, Len(Text2.Text) - 1) End Sub Private Sub Form_Load() Text1.Text = "游戏" End Sub
D3 CE是 游 的区位码。至于%号,那可能是各个字节之间的分割而已。
作者: Veron_04 发布时间: 2011-09-15
作者: Veron_04 发布时间: 2011-09-15
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28