Python + PostgreSQL + strange ascii = UTF8 encoding error
- by Claudiu
I have ascii strings which contain the character "\x80" to represent the euro symbol:
>>> print "\x80"
€
When inserting string data containing this character into my database, I get:
psycopg2.DataError: invalid byte sequence for encoding "UTF8": 0x80
HINT: This error can also happen if the byte sequence does not match the encodi
ng…