--On 23. Dezember 2005 19:28:52 +0000 Chris Withers <chris@simplistix.co.uk> wrote:
The HTTP spec says that a http server *can* set the charset to make the encoding of the payload clear. That's what we are doing now. Not specifying the charset means for the browser: *guessing* the encoding which means the browser defaults to some unspecified default encoding.
Yes, but we're essentially guessing too, right? :-S
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. -aj