When I tried to insert right double quotes (”) using python MySQLdb it produces UnicodeEncodeError: 'latin-1' codec can't encode character u'\u201d' in position 0: ordinal not in range(256)
. python MySQLdb uses latin-1 codec by default and from the index.xml file in the /usr/share/mysql/charsets/
, it is described as cp1252 West European. Hence I think that latin1 will cover cp1252 characters also. But latin1 won't cover cp1252 characters, If they does I will not get the Error.
The right double quotes are lies in cp1252 charset but not in ISO 8859-1( or latin1) charset.
There is no cp1252.xml
file in /usr/share/mysql/charsets/
. Why python MySQLdb is missing cp1252 charset?
Or whether the latin1
is same as cp1252
as they described in index.xml
.