[Zope] force charset in HTTP header from ZPT

Vahur Rebas vahur at tpu.ee
Mon Aug 16 14:58:36 EDT 2004


> <div tal:define="dummy 
> python:request.RESPONSE.setHeader('content-type', 'text/html; 
> charset=utf-8')" />
>
> leads to the error below:
>
> EOL while scanning single-quoted string (html", line 1) in expression 
> "python:request.RESPONSE.setHeader('content-type', 'text/html", at 
> line 2, column
> Zope is taking the semicolon after 'text/html' as a separator instead 
> part of the string. I tried to assign the string to a variable with 
> <div tal:define="content_type string:text/html; charset=utf-8" />, but 
> it doesn't work neither. How can I work around this?
>
Try ;; instead ;
<div tal:define="dummy 
python:request.RESPONSE.setHeader('content-type','text/html;; 
charset=utf-8')" />
Didn't try but something like that should work
I think I read about it from Zope Book.

Vahur




More information about the Zope mailing list