MariaDB / Python issues with emoji characters
问题 I have a string in x['foo'] , sometimes it's a normal string, other times it is a emoji or text art .. So, I am getting this error in trying to submit the content into database. Warning: Incorrect string value: '\xE4\xB8\xBA Co...' for column 'description' at row 1 If I use x['foo'].decode("utf-8") I get this error: UnicodeEncodeError: 'ascii' codec can't encode character u'\u4e3a' in position 0: ordinal not in range(128) If I try, encode('ascii', 'ignore').decode('ascii') Then I get this