On Thu, 10 Jul 2008 10:19:46 +0200 Morten Brekkevold morten.brekkevold@uninett.no wrote:
I've opted for the first fix, as it was smaller and quicker to implement, but if you other Django enthusiasts have comments, I would really like to hear them. I also wouldn't mind a comment from Stein Magnus, who wrote the Django/Cheetah integration in the first place :-)
First comment came offline, via Magnus, who found a problem with the patch during development on navdev. Apparently, Django doesn't always render a unicode object; sometimes it returns a str object. Calling the encode method of a str object with an 'utf-8' argument causes Puthon to decode the object as ASCII and then re-encode it as UTF-8, the former step failing when the str object already contains utf-8 data.
Revised patch attached.