code.djangoproject.com's Trac rejected my ticket as supposed spam, so
I'll try to fill it here:

template.Nodelist.render raised an exception in
<pre>
return ''.join(bits)
</pre>

UnicodeDecodeError : 'ascii' codec can't decode byte 0xd1 in position
3128: ordinal not in range(128)

The problem was that the content it tried to join had UTF-8 characters.
The *temporary* patch that worked for me was to write the render method
as follows:
<pre>
def render(self, context):
    bits = []
    for node in self:
        if isinstance(node, Node):
            bits.append(self.render_node(node,
context).decode(settings.DEFAULT_CHARSET))
        else:
            bits.append(node.decode(settings.DEFAULT_CHARSET))
    return ''.join(bits).encode(settings.DEFAULT_CHARSET)
</pre>
However, I suppose the bug can be deeper than this and should be fixed
somewhere else. 

regards, 
Max


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@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-developers
-~----------~----~----~----~------~----~------~--~---

Reply via email to