Mysqldb Can't Initialize Character Set Utf-8 Error
Solution 1:
The charset alias for UTF-8 in MySQL is utf8
(no hyphen).
See https://dev.mysql.com/doc/refman/5.5/en/charset-charsets.html for available charsets.
Note, if you need to use non-BMP Unicode points, such as emojis, use utf8mb4
for the connection charset and the varchar type.
Solution 2:
There is a thing called collations that helps encode/decode characters for specific languages. https://softwareengineering.stackexchange.com/questions/95048/what-is-the-difference-between-collation-and-character-set
I think u need to specify it when creating your databasetableor in the connection string. refer this: store arabic in SQL database
More on python mysql connection : https://dev.mysql.com/doc/connector-python/en/connector-python-api-mysqlconnection-set-charset-collation.html
Post a Comment for "Mysqldb Can't Initialize Character Set Utf-8 Error"