Excel汉字和url编码转换.docx 2页
2021-07-01
将汉字转为URL编码并填入宏代码(sStr$) As %php 汉字转url编码, $, i&, $For i = 1 To Len(sStr) = Mid$(sStr, i, 1) = Asc( ) Case 0 To 255 '127' 单字节 Case "0" To "9", "A" To "Z", "a" To "z"',"-","_"'添加其他非转义 '这些字符不转义。Case Else'所有其他字符必须转义。= Hex() = "%" & (, 2)End Else ' byte = Hex() = "%" & Left(, 2) & "%" & (, 2)End = & = 保存后用"="在表单中调用。
宏中URL编码为汉字加新模块并添加代码: ()Dim iIf(,"%") = 0 = i = 1 To Len()If Mid(php 汉字转url编码, i, 1) = "% " CInt( "&H" & Mid(, i + 1, 2))> 127 = & Chr(CInt("&H" & Mid(, i + 1, 2) & Mid(, i + 4, @k9) @)) i = i + = & Chr(CInt("&H" & Mid(, i + 1, 2)))i = i + 2End = & Mid(, i, 1)End Call "=" in 可以完全实现。