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' 單字節(jié) 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 可以完全實現。