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

2006-01-23 Thread Chris Withers
Andreas Jung wrote: A cool :-) Where's the code that checks if this header is present so I can take a look? ZPublisher/HTTPResponse.py (where else :-)) Oh :-S I was expecting a different patch... so this only affects content returned as XML? How come? huh? Sorry, my mistake,

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

2006-01-20 Thread Chris Withers
Andreas Jung wrote: --On 19. Januar 2006 18:37:35 + Chris Withers [EMAIL PROTECTED] wrote: Andreas Jung wrote: 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

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

2006-01-20 Thread Andreas Jung
--On 20. Januar 2006 10:03:03 + Chris Withers [EMAIL PROTECTED] wrote: set' set. A cool :-) Where's the code that checks if this header is present so I can take a look? ZPublisher/HTTPResponse.py (where else :-)) Oh :-S I was expecting a different patch... so this only affects

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

2006-01-19 Thread Chris Withers
Andreas Jung wrote: 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. A cool :-) Where's the code that checks if this header is

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

2006-01-19 Thread Andreas Jung
--On 19. Januar 2006 18:37:35 + Chris Withers [EMAIL PROTECTED] wrote: Andreas Jung wrote: 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

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

2006-01-05 Thread Chris Withers
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

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

2006-01-05 Thread Andreas Jung
--On 4. Januar 2006 11:23:09 +0200 Chris Withers [EMAIL PROTECTED] 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

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

2005-12-25 Thread Chris Withers
Andreas Jung wrote: How will Zope know when _not_ to add the content-type header? Makes no sense to me. Either the application set the content-type header or Zope does it for you. Check HTTPResponse.py. OK. How will Zope tell if the charset is undefined and what does undefined mean in

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

2005-12-25 Thread Andreas Jung
--On 23. Dezember 2005 19:28:52 + Chris Withers [EMAIL PROTECTED] 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

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

2005-12-21 Thread Andreas Jung
--On 21. Dezember 2005 18:07:49 + Chris Withers [EMAIL PROTECTED] wrote: How will Zope know when _not_ to add the content-type header? Makes no sense to me. Either the application set the content-type header or Zope does it for you. Check HTTPResponse.py. How will Zope tell if the

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

2005-12-19 Thread Andreas Jung
The following usecase is not handled correctly by Zope: When you call a PythonScript returning a Python unicode string then the ZPublisher/HTTPResponse code will convert the unicode response string using HTTPResponse.default_encoding to a Python string. The default encoding is configurable