ANN: CherryPy-2.1.0-beta released
Robert Brewer
fumanchu at amor.org
Fri Jul 15 13:53:32 EDT 2005
Damjan wrote:
> > I am happy to announce the first beta release of CherryPy-2.1
> ...
> > unicode decoding/encoding,
>
> This especially interesting to me.
> Is CherryPy completelly unicode (and UTF-8) ready?
> The thing that frustrates me about quixote2 is that it has a lot of
> assumptions that text is a str object in the latin1 encoding.
> I succeded to patch quixote to be usable but that may not be enough.
>
> My quixote application works with unicode objects all the
> time, and the only place I want UTF-8 is when the content
> is sent to the client... (or when its stored in a database
> or file which I handle myself fine).
Encoding is a snap in CherryPy 2.1. Write your application using unicode
objects, then have all output converted to UTF-8 by simply writing in
your config file:
encodingFilter.on = True
To use a different encoding, write:
encodingFilter.encoding = "ascii"
Encoding is restricted to a limited set of MIME types; 'text/html' is
the default list. To change that, use the config entry:
encodingFilter.mimeTypeList = ['text/html', 'text/plain']
All of these configuration entries are specifiable per-path, so
different portions of your site can use different encoding schemes.
Robert Brewer
System Architect
Amor Ministries
fumanchu at amor.org
More information about the Python-list
mailing list