Just an experience...

I created a database in mysql not caring much for charsets, and run
manage.py syncdb. All tables were created with the default charset
(iso-8892-1 swedish). Later I noticed my croatian chars were not
right, so I altered some tables and varchar fields to use utf8. This
worked well, so I made a small script to run these alter tables on all
tables/fields.

Next day I could not login to the admin - it complained that I had
cookies disabled. Googling this led me to a library conflict with php-
mhash, which I tried to solve but with no success. The servers error
log also complained about invalid padding in base64 encoded strings...
Much later I started backtracing all my steps and after I altered the
auth_session table back to iso-8859-1 things worked again.

Observations:

- If utf8 is the default in django, I think it would help if all
database operations were run with explicit charset options. I.e.
create table ( ... x varchar(100) charset utf8,...) charset utf8;
- It is not clear to me why changing the charset on auth_session would
break things. Keys and data are base64 encoded and use only ascii
anyway, so switching between iso-8859-1 and utf8 should change
nothing.

Hope this helps some poor soul in the future :-)

--
Krešimir Tonković
Multimodus d.o.o.
www.multimodus.hr

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.


Reply via email to