擅长:python、mysql、java
<p>转换为Unicode是通过对字符串进行解码来完成的(假设您得到的是字节):</p>
<pre><code>data = "haer ueber loess"
word = data.decode('utf-8') # actual encoding depends on your data
</code></pre>
<p>也可以使用unicode字符串定义dict:</p>
^{pr2}$
<p>最后,<code>print umlautdict</code>将打印出该dict的一些表示,通常涉及转义。这很正常,你不用担心。在</p>