[Zope3-dev] Re: Encoding of the PageTemplateFile

Dmitry Vasiliev lists at hlabs.spb.ru
Wed Jul 13 03:04:35 EDT 2005


Philipp von Weitershausen wrote:
> Dmitry Vasiliev wrote:
> 
>> Hi!
>>
>> Some time ago there has been a discussion on Zope3-Users list about 
>> specifying an encoding of the PageTemplateFile like this:
>>
>> <browser:page
>>     template="tempalte.pt"
>>     encoding="utf-8"
>>     ...
>> />
>>
>> So there are some questions:
>>
>> - Is anybody working on this?
>> - What should be the default encoding if no encoding is given? UTF-8?
>> - Can we include this functionality in Zope 3.1 release? I guess we at 
>> least can set the default encoding of the PageTemplateFile to "UTF-8" 
>> without any problems.
> 
> 
> I wouldn't mind such a change, but I think it's a little too late for 
> 3.1. The first beta of 3.1 is already out, that means a feature freeze.

Ok. But default 'ascii' encoding seems like a bug for me and I want to change 
it to 'utf-8' before the release.

> In the long term, I would rather have this specified the way it should 
> be with XML data: using an <?xml version="1.0" encoding="utf-8" ?> 
> processing instructions.
> 
> The reason this doesn't work right now (or, I should say, work the way 
> you'd expect it) is because the PageTemplate machinery makes the (now 
> unnecessary) distinction between HTML and XML. It uses two different 
> parsers for those; that way it can support SGML-based HTML4. HTML mode 
> is the default, XML mode gets triggered by an <?xml ?> processing 
> instruction like the one above.
> 
> Apart from enforcing XML syntax, XML mode also requires you to 
> explicitly provide definitions for the TAL, METAL and i18n namespaces (I 
> think this is a good thing because a) it's the standard and b) people 
> from other technologies know standard and are tired of Zope constantly 
> cooking its own soup). Also, macros from XML PageTemplates are 
> incompatible with macros from HTML PageTemplates.
> 
> So, to conclude, I would propose to rip out HTML mode of PageTemplates 
> completely in the long term. Everyone nowadays uses XHTML, the drawbacks 
> are (apart from the required namespace declarations) none and the 
> benefits apart from the discussed encoding issue are a) less code to 
> maintain and b) compliance with standards.

I don't agree. Now I want to use PageTemplates for i-mode HTML which is like 
restricted HTML, not XHTML.

-- 
Dmitry Vasiliev (dima at hlabs.spb.ru)
     http://hlabs.spb.ru


More information about the Zope3-dev mailing list