On 11/1/06, mamcxyz <[EMAIL PROTECTED]> wrote: > > I having this error: > > OperationalError: (1267, "Illegal mix of collations > (latin1_general_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for > operation '='") > > When I try to run code like this: > > City.objects.filter(name='Medellín') > > I have a working site where I need to perform a data upgrade, and is > common have this kind of city names (is a site for Colombia, in > spanish) > > Never before get this problem... > > I use MySql 4. > > > I try to do > City.objects.filter(name='Medellín'.encode/decode('latin_1')) > > with not look. > > I search on Google and found this is a reported problem with Django but > not understand what to do...
I assume your database is in latin1. Django tries to force utf8 if your server version is at least 4.1. Are you using 4.0 or 4.1? Try: City.objects.filter(name=u'Medellín') This ultimately passes a unicode object to MySQLdb which should encode it into the connection's character set encoding, which I guess will be latin1. BTW, what version of MySQLdb are you using? -- This message has been scanned for memes and dangerous content by MindScanner, and is believed to be unclean. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---