Decode a hex string into Chinese characters
<p>I have a hex code: %E7%B5%99.
I want to convert it into Chinese characters.</p>

<pre><code>print ("%E7%B5%99".decode('utf-8'))
</code></pre>

<p>This doesn't seem to work.</p>

<p>It should give the answer: çµ</p>

<p>You need to "unquote" the percent encoded string first. Then decode from UTF8:</p>

<pre><code>&gt;&gt;&gt; s = "%E7%B5%99"
&gt;&gt;&gt; print urllib.unquote(s).decode('utf8')
çµ
</code></pre>

python python-2.7