Thanks a lot for the tips. I was able to find a somewhat hackish solution.

> From: django-users@googlegroups.com 
> - If you're using a version of MySQL prior to 4.1, you should 
> consider upgrading.  4.1 has a lot more support for unicode.

Using 4.1.11

> - Are you *sure* that your entire database is in utf8?  I 
> thought mine was (it's a long story) but it turned out that 
> many tables were still in latin1, with the Japanese text 
> encoded in latin1.  Check your database and all your 
> individual tables to make sure.  Do a mysqldump and look at 
> the CHARSET settings for each table.

This was it, it appears. The server encoding is utf-8, but the client is
latin-1. 

Changing the client setting to utf-8 seemed like a lot of hassle (i.e. I
don't know how to do it), so I solved the problem by hacking into django's
mysql backend code, and commenting out the "SET NAMES" command.

# django/db/backends/mysql/base.py ~L104-105

# COMMENTED OUT BY RFG 12:16 2006/11/29
#               if self.connection.get_server_info() >= '4.1':
#                       cursor.execute("SET NAMES 'utf8'")

Doing this, my data goes in and out untouched. A somewhat unsatisfying
solution, but it seems to work.

Regards,
Ryan Ginstrom


--~--~---------~--~----~------------~-------~--~----~
 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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to