#4021: [unicode] initial sql with non-ascii strings not imported
----------------------------------------------------------+-----------------
Reporter: Ivan Sagalaev <[EMAIL PROTECTED]> | Owner: jacob
Status: new |
Component: Uncategorized
Version: other branch |
Resolution:
Keywords: unicode |
Stage: Unreviewed
Has_patch: 0 |
Needs_docs: 0
Needs_tests: 0 |
Needs_better_patch: 0
----------------------------------------------------------+-----------------
Changes (by Ivan Sagalaev <[EMAIL PROTECTED]>):
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
Found it...
The problem occurs in management.py in syncdb where it passes raw file
contents as str into cursor.execute(). Now since we have {'use_unicode':
True} for mysql backend it apparently expects only unicode data.
The obvious fix would be decoding content of custom .sql files in syncdb.
Here we have the same problem as with templates: we can't know for sure in
which encoding the file is. Another way to do it is to connect to MySQL
during syncdb with {'use_unicode': False} and without explicit charset. I
think this is correct since syncdb is a command line tool and shouldn't
care about unicode internals.
Thoughts?
--
Ticket URL: <http://code.djangoproject.com/ticket/4021#comment:1>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [EMAIL PROTECTED]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---