小编Mah*_*ini的帖子

如何解码包含阿拉伯字符的(百分比编码 URL)?

我想转换所有语言的百分比编码 URL,但 vb6 仅支持英语。

我已经测试了以下代码。但它只能转换英文字符:

Private Sub Form_Load()
    THE_ARABIC_URL = "%D8%AF%D8%B4%D9%85%D9%86%DB%8C+%D8%AF%D8%B1+%D8%A7%D8%B9%D9%85%D8%A7%D9%82-2019-12-09+01%3A09%3A00"
    MsgBox URLDecode(THE_ARABIC_URL)
End Sub

Private Function URLDecode(ByVal txt As String) As String
    Dim txt_len As Integer
    Dim i As Integer
    Dim ch As String
    Dim digits As String
    Dim result As String

    result = ""
    txt_len = Len(txt)
    i = 1
    Do While i <= txt_len
        ' Examine the next character.
        ch = Mid$(txt, i, 1)
        If ch = "+" Then
            ' Convert to space character.
            result = result …
Run Code Online (Sandbox Code Playgroud)

vb6 urlencode utf-8

6
推荐指数
1
解决办法
476
查看次数

标签 统计

urlencode ×1

utf-8 ×1

vb6 ×1