Just another update
This commit is contained in:
parent
a25938f123
commit
00a190b0a6
6591 changed files with 94363 additions and 23227 deletions
|
|
@ -1,7 +1,19 @@
|
|||
rawURL = http://foo bar/
|
||||
SetFormat, Integer, Hex
|
||||
Loop Parse, rawURL
|
||||
If A_LoopField is not alnum ; not a-zA-Z0-9
|
||||
encURL .= "%" . SubStr(Asc(A_LoopField), 3)
|
||||
else encURL .= A_LoopField
|
||||
MsgBox % encURL
|
||||
MsgBox, % UriEncode("http://foo bar/")
|
||||
|
||||
; Modified from http://goo.gl/0a0iJq
|
||||
UriEncode(Uri)
|
||||
{
|
||||
VarSetCapacity(Var, StrPut(Uri, "UTF-8"), 0)
|
||||
StrPut(Uri, &Var, "UTF-8")
|
||||
f := A_FormatInteger
|
||||
SetFormat, IntegerFast, H
|
||||
While Code := NumGet(Var, A_Index - 1, "UChar")
|
||||
If (Code >= 0x30 && Code <= 0x39 ; 0-9
|
||||
|| Code >= 0x41 && Code <= 0x5A ; A-Z
|
||||
|| Code >= 0x61 && Code <= 0x7A) ; a-z
|
||||
Res .= Chr(Code)
|
||||
Else
|
||||
Res .= "%" . SubStr(Code + 0x100, -1)
|
||||
SetFormat, IntegerFast, %f%
|
||||
Return, Res
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue