[Zope] force charset in HTTP header from ZPT
Hong Yuan
hongyuan at homemaster.cn
Mon Aug 16 19:21:16 EDT 2004
Vahur Rebas wrote:
>
>> <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.
Thanks. ;; works as the escape for ; in tal expresseions.
More information about the Zope
mailing list