Login
网站首页 > 文章中心 > VB6

VB6 GET提交封装函数代码分享

作者:小编 更新时间:2023-07-05 11:43:21 浏览量:99人看过

Visual Basic 6 迷你版安装包2023

软件介绍:本站发布这款安装包是VB6迷你版(不是精简版)迷你版在WIN11等高级别系统下不会出错,当前最便捷的安装版本

Public Function UTF8EncodeGET(ByVal szInput As String) As String

    Dim wch As String

    Dim uch As String

    Dim szRet As String

    Dim x As Long

    Dim inputLen As Long

    Dim nAsc As Long

    

    If szInput = "" Then

        UTF8EncodeGET = szInput

        Exit Function

    End If

    

    inputLen = Len(szInput)

    

    For x = 1 To inputLen

        ' Get each character

        wch = Mid(szInput, x, 1)

        

        ' Get the corresponding UNICODE encoding

        nAsc = AscW(wch)

        

        ' Check if it's less than 0 and add 65536

        If nAsc < 0 Then nAsc = nAsc + 65536

        

        ' Check if it's an ASCII character (<128)

        If (nAsc And &HFF80) = 0 Then

            szRet = szRet & wch

        Else

            ' Encode the character as UTF-8

            uch = "%" & Hex(nAsc \ 2 ^ 8) & "%" & Hex(nAsc Mod 256)

            szRet = szRet & uch

        End If

    Next

    

    UTF8EncodeGET = szRet

End Function


版权声明:倡导尊重与保护知识产权,本站有部分资源、图片来源于网络,如有侵权,请联系我们修改或者删除处理。
转载请说明来源于"土嘎嘎" 本文地址:http://www.tugaga.com/jishu/vb/1002.html
<<上一篇 2023-07-04
下一篇 >> 2023-07-05

编辑推荐

热门文章