Unicodeencodeerror: ' latin-1 ' codec can ' t encode character
"Unicodeencodeerror: ' latin-1 ' codec can ' t encode character ..."
This was because mysqldb normally tries to encode Everythin to latin-1. This can is fixed by executing
It is important for MySql to modify the database encoding to UTF8 to avoid gibberish. bitsCN. commysql to specify the encoding when creating the database. many developers use the default encoding, which is difficult to prevent. Coding databases can
It is very important for MySql to change the database encoding to UTF8 when creating a database. Many developers use the default encoding, which is difficult to prevent. Coding databases can avoid garbled characters caused by import and export.
Exception: Unicodeencodeerror: ' latin-1 ' codec can ' t encode character U ' \u201c ' in position 0:ordinal not in range (256)Need to set database connection encoding: DB = pymysql.connect (host= ' localhost ', user= ' root ', password= ' 123456 ',
MySQL to create a database when the specified encoding is important, many developers have used the default encoding, garbled problem is impossible to guard against. The coding of the database can avoid the garbled problem caused by the pouring of
For the Chinese coding problem, there will always be a variety of disgusting errors, do not know how to solve, first of all, you should focus on the coding problem from the beginning, try to ensure that all coding methods are consistentUse
MySQL is prone to garbled problems when porting data containing Chinese. Many of them appeared when transplanted from mysql4.x to mysql5.x. The default character set for MySQL is Latin1, and many people use the latin1 character set when using mysql4.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.