I have a very basic Python script I wrote mostly for learning purposes.
It opens a terminal in the current folder. However, I can't get it to work in folders with accented characters in the URI (e.g.: /home/pablo/Vídeos
or /home/pablo/Área de Trabalho
), because it looks like Nautilus URIs are encoded to those %{number} values. Is there a way to convert these URIs to normalized URIs without having to translate every possible accented value by hand?
It's not very clear from you question, but it looks like your are searching for urllib. Note that urllib expects 8 bit strings, so you will need to do some fancy decode/encode. Welcome to python2 somewhat weird unicode support, pythn3 is way better.
You can use urllib.qoute instead of *urllib.quote_plus*, it will not quote spaces, + (pluses) and / (slashes). Both functions accept a string as a second parameter, they will keep any character in that string as is (I mean it will not quote it) in the output string. Note that the default value for safe, the name of the second parameter, is '/' for quote and '' for quote_plus. If you don't include a slash in your second parameter quote will change it.