On 28 Aug 2006, at 01:40, gabor wrote:

>
> [EMAIL PROTECTED] wrote:
>> What does one need to do to set up MySQL to handle Unicode with  
>> Django?
>>  I found that I could not input Unicode characters in the admin
>> interface when using MySQL as the back end.  Everything works  
>> perfectly
>> out of the box with Postgres, though.
>>
>
> sorry, i don't know how to set up MySQL.

For reference, installing it, some post installation, and etc..:
   http://dev.mysql.com/doc/refman/5.0/en/installing.html

> in case of postres, the only thing is to create the db with the  
> correct
> encoding ("createdb -E utf8").

  mysql> CREATE DATABASE db1 CHARACTER SET utf8;

>
> i assume it's the same for mysql.

Django's MySQL backend does following for MySQL version 4.1 and higher:
   cursor.execute("SET NAMES 'utf8'")
So on the client site you are talking (kinda) UTF8 with the server,  
but your database, tables and columns needs to be UTF8 as well.

In our MySQL manual this is explained here:
   http://dev.mysql.com/doc/refman/5.0/en/charset.html

If you made your databases and/or tables and/or columns with a  
specific character sets, then following place in the manual is  
important:
   http://dev.mysql.com/doc/refman/5.0/en/charset-connection.html

Cheers,

Geert

-- 
Geert Vanderkelen
http://some-abstract-type.com




--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to