lune-org/lune

Url Encoding

Closed this issue · 3 comments

I'm opening this specifically for emoji url encoding for discord, but url encoding has many usecases. Just a nice feature to have.

You can easily make this with string.gsub

You can easily make this with string.gsub

The percent-encoding spec for urls is not that trivial to implement. If you only need to encode things like certain ascii characters and spaces, string.gsub or one of the other string manipulation functions is probably fine, but if you want to support different character sets, emojis, or raw bytes it gets a lot trickier (and slower).

net.urlEncode and net.urlDecode have been added for the upcoming version 0.6.0