I'm working on an application that will work as a cli trash app (I know trash-cli exists, this is a personal project :) ), one of the problems I encountered is that your trash info (when you move something to trash, an info file is generated to store it's original location) stores the info in RFC 2396 format, so spaces becomes %20
and an opening bracket becomes an %28
. (here is an example: /home/netsu/Documents/Music%20%28copy%29
)
My question is, how can I convert /home/netsu/Documents/Music (copy)
into /home/netsu/Documents/Music%20%28copy%29
and vice versa in Nim? Python has things like urllib.urlencode
which I believe does this, but I don't know of such a useful feature in Nim.
You can take a look at uri.encodeUrl and uri.decodeUrl: https://nim-lang.org/docs/uri.html#encodeUrl%2Cstring