Skip to content

Instantly share code, notes, and snippets.

View pbelyaev's full-sized avatar
🧑‍💻
👍

Pavel Beliaev pbelyaev

🧑‍💻
👍
View GitHub Profile
@cgwxyz
cgwxyz / urldecode_encode.lua
Last active June 23, 2020 14:09
lua urlencode/urldecode
function encodeURI(str)
if (str) then
str = string.gsub (str, "\n", "\r\n")
str = string.gsub (str, "([^%w ])",
function (c) return string.format ("%%%02X", string.byte(c)) end)
str = string.gsub (str, " ", "+")
end
return str
end