[Zope-dev] [ZPublisher] specifiying 'charset' for the content-type header

Andreas Jung lists at andreas-jung.com
Thu Jan 5 04:55:14 EST 2006



--On 4. Januar 2006 11:23:09 +0200 Chris Withers <chris at simplistix.co.uk> 
wrote:

> Andreas Jung wrote:
>>
>> No. Imagine a PythonScript that returns a unicode string. The ZPublisher
>> converts the unicode string to latin1 (zpublisher_default_encoding). Most
>> browsers will default Latin1 when they can't find the charset in the
>> content-type header. When you configure the ZPublisher to convert output
>> to utf-8 then browsers will still default to Latin1 although the output
>> it utf-8. So we tell the browser which encoding the ZPubisher was using
>> to produce the output.
>
> Ah, okay, and how would I indicate in my PythonScript return that I'm
> returning something different to what is specified in
> zpublisher_default_encoding?
>

By setting the content-type header _with_ a 'charset' set.

-aj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope-dev/attachments/20060105/636bcfcb/attachment.bin


More information about the Zope-Dev mailing list