[Zope] zpt encoding and content-type

Bernd Dorn zope-mailinglist at mopa.at
Wed Oct 22 05:07:44 EDT 2003


hight all

i use PageTemplateFile in my python product. now I'm wondering if there 
is some way to redefine the content-type and the encoding of the 
response object in the file

i tried the suggestion on zopelabs, to set it like the following 
somewhere in a tal:replace::

  python:request.response.setHeader ...

but this does not affect my response. it seems that PageTemplateFile 
always uses text/xml if an xml PI is on the top of the source file. It 
sniffs the content-type from the PI.

what I basically want to do is, to define the encoding in the xml PI 
(e.g <?xml version="1.0" encoding="iso-8859-1"?>) so that I dont get 
unicode conversion errors (ascii out of range ...) when the file is read
but this results in a text/xml content type

tia, bernd






More information about the Zope mailing list