擅长:python、mysql、java
<p>把这个放在源代码的开头:</p>
<pre><code># -*- coding: utf-8 -*-
</code></pre>
<p>不要对已经编码的内容进行编码-删除<code>my_text.encode('utf-8')</code></p>
<p>在连接调用中使用<code>charset="utf8", use_unicode=True</code>。在</p>
<p>表/列中的<code>CHARACTER SET</code>必须是<code>utf8</code>或{<cd5>}。<code>latin1</code>是否会使<em>不</em>正常工作。在</p>
<p><a href="http://mysql.rjweb.org/doc.php/charcoll#python" rel="nofollow">Python checklist</a></p>