back to xoc3.io

2021-08-31 - urlencode & urldecode

i've been up to a lot of things recently including:

but unrelated to all of that, this post is about 3 nearly identical python snippets i improved upon from finding on stack overflow:

these aliases do what they say. the first one encodes text to url encoding. the second one encodes, but will also encode slashes too. and the third one decodes url encoding into plain text. all 3 aliases work with either cli args or reading from stdin. i looked this up because i was using a lot of curl for work recently and found myself needing to urlencode/decode things a bunch. it's always nice to add another small tool to your cli belt.

here is that stack overflow post