擅长:python、mysql、java
<p>我有一个解决方法,它太简单了,只需将读取的字符串解码回unicode字符串,然后将其传递到“unidecode”库。在</p>
<pre><code>>>> accented_string = 'Málaga'
>>> accented_string_u = accented_string.decode('utf-8')
>>> import unidecode
>>> unidecode.unidecode(accented_string_u)
>>> Malaga
</code></pre>