7.2.3 Encoding

Syntax: Encoding = encoding
Default: depends on response

Set the encoding to use when sending the http response. The way the encoding is used depends on the type of the response.

If the response is in unicode (for example because the template was stored in unicode, or because response.write() was used to write unicode), the encoding is used to encode the response. If no encoding is supplied, ``utf-8'' is assumed.

If response is a plain 8bit string, the response is assumed to be already in this encoding. If no encoding is supplied, ``iso-8859-1'' is assumed.

In both cases, the encoding is passed to the client as the ``charset'' parameter of the ``Content-Type'' http header.