Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
11
Task/URL-decoding/Lua/url-decoding.lua
Normal file
11
Task/URL-decoding/Lua/url-decoding.lua
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
function decodeChar(hex)
|
||||
return string.char(tonumber(hex,16))
|
||||
end
|
||||
|
||||
function decodeString(str)
|
||||
local output, t = string.gsub(str,"%%(%x%x)",decodeChar)
|
||||
return output
|
||||
end
|
||||
|
||||
-- will print "http://foo bar/"
|
||||
print(decodeString("http%3A%2F%2Ffoo%20bar%2F"))
|
||||
Loading…
Add table
Add a link
Reference in a new issue