7,763
社区成员
发帖
与我相关
我的任务
分享
Private Sub command1_click()
Me.Print (UTF8EncodeURI("频道1"))
End Sub
Function UTF8EncodeURI(szInput)
Dim wch, uch, szRet
Dim x
Dim nAsc, nAsc2, nAsc3
If szInput = "" Then
UTF8EncodeURI = szInput
Exit Function
End If
For x = 1 To Len(szInput)
wch = Mid(szInput, x, 1)
nAsc = AscW(wch)
If nAsc < 0 Then
nAsc = nAsc + 65536
End If
If (nAsc And &HFF80) = 0 Then
szRet = szRet & "&H" & Hex(Asc(wch)) & "&H00"
Else
If (nAsc And &HF000) = 0 Then
uch = "&H" & Hex(((nAsc \ 2 ^ 6)) Or &HC0) & Hex(nAsc And &H3F Or &H80)
szRet = szRet & uch
Else
uch = "&H" & Hex((nAsc \ 2 ^ 12) Or &HE0) & "&H" & _
Hex((nAsc \ 2 ^ 6) And &H3F Or &H80) & "&H" & _
Hex(nAsc And &H3F Or &H80)
szRet = szRet & uch
End If
End If
Next
UTF8EncodeURI = szRet
End Function