Skip to content

Instantly share code, notes, and snippets.

View Sledmine's full-sized avatar

Sled Sledmine

View GitHub Profile
local char_to_hex = function(c)
return string.format("%%%02X", string.byte(c))
end
local function urlencode(url)
if url == nil then
return
end
url = url:gsub("\n", "\r\n")
url = url:gsub("([^%w ])", char_to_hex)