Hello,

On 29 Lip, 15:56, cootetom <coote...@gmail.com> wrote:
> To add, something just popped into my head. Have you got
> DEFAULT_CHARSET = 'utf-8' in your settings.py fiile

It didn't help.

> On Jul 29, 2:51 pm, cootetom <coote...@gmail.com> wrote:
>
> > I would imagine that the deserialize function tries to encode the
> > input down to ascii. My suggestion would be to find the XML serializer
> > code and see what it is doing with the input string you pass to it.

Thanks for inspiration, although smart_unicode() and encode('utf-8')
in save() is not helping much, after changing /usr/lib/python2.5/xml/
sax/expatreader.py, line 207:

--BEFORE --

       try:
            # The isFinal parameter is internal to the expat reader.
            # If it is set to true, expat will check validity of the
entire
            # document. When feeding chunks, they are not normally
final -
            # except when invoked from close.
            self._parser.Parse(data, isFinal)
        except expat.error, e:
            exc = SAXParseException(expat.ErrorString(e.code), e,
self)
            # FIXME: when to invoke error()?
            self._err_handler.fatalError(exc)

-- AFTER --

       try:
            # The isFinal parameter is internal to the expat reader.
            # If it is set to true, expat will check validity of the
entire
            # document. When feeding chunks, they are not normally
final -
            # except when invoked from close.

            data = data.encode('utf-8') # this makes difference

            self._parser.Parse(data, isFinal)
        except expat.error, e:
            exc = SAXParseException(expat.ErrorString(e.code), e,
self)
            # FIXME: when to invoke error()?
            self._err_handler.fatalError(exc)

It works. Thank you!

Best regards,
Luke
--~--~---------~--~----~------------~-------~--~----~
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