Thomas Hunger wrote:
> I currently have the following construct all over the place:
> 
>   t = Template(...)
>   return unicode(t.serialize(fragment=True, encoding='utf8'), 'utf8')
> 
> Is there an official way to persuade serialize to return a unicode 
> object directly? (Right now the return type is str, no matter what I 
> try.)

Unfortunately, no. Even if you pass None as encoding, 'utf8' is assumed 
anyway, and you would need to change a lot of the inner workings of Kid 
to change that behavior. This is one of the things that have been solved 
better in Genshi. You can simply pass None as encoding to Genshi's 
render() method, and you will get unicode.

-- Chris


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
kid-template-discuss mailing list
kid-template-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kid-template-discuss

Reply via email to