Niran Babalola wrote: > I've been developing a Django application using SQLite, and now I'm > trying to move over to MySQL and actually launch the site. The > application is storing data from RSS/Atom feeds using Universal Feed > Parser, which uses unicode strings for all its data. When I try to > store information from a feed into my MySQL database, I get the > following error: > > "UnicodeEncodeError: 'latin-1' codec can't encode characters in > position 75-76: ordinal not in range(256)" > > Everything worked fine with SQLite, but I haven't been able to get past > this problem with MySQL. I tried dropping the database and recreating > it with utf8 as the default encoding, but that didn't help either. Any > ideas?
hi, please give us the whole stacktrace, and the line of the code where this happens. generally, this might happen because you're trying to directly put unicode text into the database (i have no experience with mysql, so i can be wrong here). the various database-backends react differently to save-unicode-data (sqlite3 usually works ok, psycopg1 fails, psycopg2 works etc.). so, before saving the data, convert it explicitly to byte-strings with a suitable charset (i assume you're using utf8). gabor --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~----------~----~----~----~------~----~------~--~---