On Sat, Dec 6, 2008 at 2:59 PM, Rob Hudson <[EMAIL PROTECTED]> wrote:

>
> Wow, thanks so much Karen, for slicing and dicing the problem like
> that.
>
> On Dec 6, 10:36 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> > You could also just convert the character set used on the MySQL side:
> >
> > http://dev.mysql.com/doc/refman/5.0/en/charset-conversion.html
> >
> > Presumably since MySQL knows it really means cp1252 for stuff it calls
> > latin1, it would convert properly to utf-8 when you told it to.  You'd
> > sidestep the issues you've hit with 'latin1' meaning different things to
> > different pieces of software.
>
> The problem is, there is no cp1252 character set in MySQL as far as I
> can tell, since cp1252 == latin1 to mysql.  And setting the keyword
> argument to connect to "charset='cp1252'" threw a MySQL error.
>
> My data migration script is working now, though, when I don't specify
> 'use_unicode=True' and manually run .decode('cp1252') on the columns I
> need to.
>
>
What I meant was you could use the mysql program and commands like:

ALTER TABLE book CONVERT TO CHARACTER SET utf8;

to get MySQL to do the conversion itself.  Presumably it would convert what
it calls latin1 to utf8 correctly. (I'd first do it on a dumped/reloaded to
a test DB version before trying such a command on a production DB.)

But if you've got your migration script working, then there's no point with
experimenting to see if you could get MySQL to do it correctly itself.

Karen

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