au3的编码参数是什么 我想把中文变成编码
比如http://www.baidu.com/s?wd=草泥马变成http://www.baidu.com/s?wd=%B2%DD%C4%E0%C2%ED 要怎么弄啊
我现在的代码是这样的 但是只能在IE下正常 用其他浏览器就是乱码 需要编码才能正常访问#NoTrayIcon
Dim $I, $str
If $CmdLineRaw = "" Then
Exit
Else
$CmdNub = StringSplit($CmdLineRaw, " ")
Switch $cmdline
Case "g"
For $I = 2 To $CmdNub
$str &= $cmdline[$I] & " "
Next
ShellExecute("http://www.google.com/search?hl=zh-CN&ie=GB2312&q=" & $str)
Case "b"
For $I = 2 To $CmdNub
$str &= $cmdline[$I] & " "
Next
ShellExecute("http://www.baidu.com/s?wd=" & $str)
Case "y"
For $I = 2 To $CmdNub
$str &= $cmdline[$I] & " "
Next
ShellExecute("http://one.cn.yahoo.com/s?p=" & $str)
Case "w"
For $I = 2 To $CmdNub
$str &= $cmdline[$I] & " "
Next
ShellExecute("http://www.youdao.com/search?q=" & $str)
EndSwitch
EndIf Func UrlEncode($Url)
Local $string, $string_1, $string_2, $iret, $i, $j
$string = StringSplit($Url, "")
For $i = 1 To $string
Switch AscW($string[$i])
Case 33, 34, 36, 38 To 126
$iret &= $string[$i]
Case Else
$string_1 = StringSplit(StringTrimLeft(StringToBinary($string[$i], 4), 2), "")
$string[$i] = ""
For $j = 1 To $string_1 Step 2
$string[$i] &= "%" & $string_1[$j] & $string_1[$j + 1]
Next
$iret &= $string[$i]
EndSwitch
Next
Return $iret
EndFunc ;==>UrlEncode 怎么用 加在哪里?
页:
[1]