On Mon, Jul 6, 2009 at 11:52 AM, Andrew Fong <fongand...@gmail.com> wrote:

>
> I'm using a SQLite3 backend on Python 2.6 and saving a unicode string
> with the null character (u'\x00') results in everything after that
> character being truncated.
>
> For example:
>
> m = MyModel(name=u'abc\x00def')
> m.save()
> MyModel.objects.get(pk=m.pk).name # => u'abc'
>
> I've tried using both the sqlite3 library included with Python and the
> pysqlite2, but I still get this error. I'm not sure whether this error
> is specific to SQLite3, the python-interface, or Django. This all
> seems to work fine in MySQL however.
>
> -- Andrew
> >
>
I'd try performing the same operations at the SQLite shell and see if you
get the same behavior.  If you do I'd guess that either it's a bug in
SQLite, or you need to escape the NULL character (which would make sense if
they're using C strings).

Alex

-- 
"I disapprove of what you say, but I will defend to the death your right to
say it." --Voltaire
"The people's good is the highest law."--Cicero

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