UTF8 Character in URL String
<p>I wrote a little Python script that parses a website.
I got a "Ã¤" character in form of <code>\u00e4</code> in a url from a link like <code>http://foo.com/h\u00e4ppo</code>, and I need <code>http://foo.com/hÃ¤ppo</code>.</p>

<p>Unluckily this depends heavily on the encoding of the site you parsed, as well as your local IO encoding. </p>

<p>I'm not really sure if you can translate it after parsing, and if it's really worth the work. If you have the chance to parse it again you can try using python's <code>decode()</code> function, like:</p>

<p><code>text.decode('utf8')
</code></p>

<p>Besides that, check that the encoding used above is the same that in your local environment. This is specially important on Windows environments, since they use <code>cp1252</code> as their standard encoding.</p>

<p>In Mac and Linux: <code>export PYTHONIOENCODING=utf8</code>
In Windows: <code>set PYTHONIOENCODING=utf8</code></p>

<p>It's not much, but I hope it helps.</p>

python url encoding