Andy Dustman wrote: > On 10/25/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > Hi, > > I want to store Chinese characters in my MySQL 4.1.11 through Django > > but unluckily, like most novices, I get totally mess characters when > > displaying them on utf-8 encoded templates. > > After some investigation I found that the tables created by 'manage > > syncdb' are actually encoded by 'latin-1'. After changing the character > > set manually(using the 'alter table xxx convert to character set > > 'utf8''), the characters were finely displayed:-) > > > > So, do I have to change my table encoding manually every time after > > performing 'manage syncdb'? That must be very painful:( > > A couple options: > > In your MySQL server configuration, you can set default-character-set > = utf8 and then this will be used for your connection any any tables > you create. > > Another option is to set the default character set on the database > with CREATE DATABASE xxx CHARACTER SET UTF8. > > http://dev.mysql.com/doc/refman/5.0/en/alter-database.html > > You want to do this prior to creating tables, of course. ALTER > DATABASE can be uased to set the default on an existing database, but > doesn't affect existing tables.
I have also a problem with MySQL utf8 coding I use MySQL database with utf8 character set and utf8_czech_ci collation. It works well on Linux server( with mod_python) but when I try to export the data and import into the same Django application but running on XP machine with runserver ,the utf8 is gone.Instead of a proper coding there are some strange characters. How can I solve the problem? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---