Re: [Zope-dev] Content Type Meta tag stripping in zope.pagetemplate

2012-03-27 Thread Marius Gedminas
On Tue, Mar 27, 2012 at 12:36:19PM +0200, Charlie Clark wrote: > Am 27.03.2012, 12:16 Uhr, schrieb Fred Drake : > > >In other words... "the web" will continue to thrive on hacks and > >sniffing data to support users' expectations in spite of the data on > >"the web". I appreciate the motivation (

Re: [Zope-dev] Content Type Meta tag stripping in zope.pagetemplate

2012-03-27 Thread Charlie Clark
Am 27.03.2012, 16:04 Uhr, schrieb Fred Drake : Transcoding on the fly? The page template generates Unicode; that's then encoded. Are you suggesting we shouldn't be using Unicode as the internal representation? Not at all, just harking back to the time when we didn't use unicode internally.

Re: [Zope-dev] Content Type Meta tag stripping in zope.pagetemplate

2012-03-27 Thread Fred Drake
On Tue, Mar 27, 2012 at 6:36 AM, Charlie Clark wrote: > True but I think that the problem was largely of our own making in not > coming up with "one, preferably only one" way of handling this. Re-reading > Marius' post I was struck by the whole idea of the http-server transcoding > the content on

Re: [Zope-dev] Content Type Meta tag stripping in zope.pagetemplate

2012-03-27 Thread Charlie Clark
Am 27.03.2012, 12:16 Uhr, schrieb Fred Drake : In other words... "the web" will continue to thrive on hacks and sniffing data to support users' expectations in spite of the data on "the web". I appreciate the motivation (it's not the users' fault the content provider can't get it right), it sadd

Re: [Zope-dev] Content Type Meta tag stripping in zope.pagetemplate

2012-03-27 Thread Miano Njoka
> > > > """ > It is better to encode your Web pages in UTF-8, and serve them as such. In > HTTP, the HTTP header has priority, then the meta name contained in HTML. > Some Web pages have specific encoding. It happens often on the Web that the > Web page encoding is different from the one specified

Re: [Zope-dev] Content Type Meta tag stripping in zope.pagetemplate

2012-03-27 Thread Fred Drake
On Tue, Mar 27, 2012 at 4:54 AM, Charlie Clark wrote: > """ > We had bug reports about Web sites sending BOM different from the HTTP > header. > """ In other words... "the web" will continue to thrive on hacks and sniffing data to support users' expectations in spite of the data on "the web". I

Re: [Zope-dev] Content Type Meta tag stripping in zope.pagetemplate

2012-03-27 Thread Charlie Clark
Am 25.02.2012, 00:18 Uhr, schrieb Marius Gedminas : The HTML spec requires that: "To sum up, conforming user agents must observe the following priorities when determining a document's character encoding (from highest priority to lowest): 1. An HTTP "charset" parameter in a "Content-Typ

Re: [Zope-dev] Content Type Meta tag stripping in zope.pagetemplate

2012-02-24 Thread Marius Gedminas
On Fri, Feb 24, 2012 at 09:57:57PM +0100, Charlie Clark wrote: > Am 24.02.2012, 09:47 Uhr, schrieb Miano Njoka : > > >While it is not essential, it is necessary in some cases where the > >finished document will be read from disk or is used by other > >applications eg. Deliverance[http://packages.p

Re: [Zope-dev] Content Type Meta tag stripping in zope.pagetemplate

2012-02-24 Thread Charlie Clark
Am 24.02.2012, 09:47 Uhr, schrieb Miano Njoka : While it is not essential, it is necessary in some cases where the finished document will be read from disk or is used by other applications eg. Deliverance[http://packages.python.org/Deliverance/]. In fact w3c's HTML validator throws a warning tha

[Zope-dev] Content Type Meta tag stripping in zope.pagetemplate

2012-02-24 Thread Miano Njoka
On Thu, Feb 23, 2012 at 2:44 PM, Fred Drake wrote: > On Thu, Feb 23, 2012 at 2:54 AM, Miano Njoka wrote: >> Yes, this is true, but why strip out the meta tag from the resulting HTML? > > Two reasons: > > 1. It may be incorrect. > > 2. If multiple templates are used to construct a response, differ

Re: [Zope-dev] Content Type Meta tag stripping in zope.pagetemplate

2012-02-23 Thread Fred Drake
On Thu, Feb 23, 2012 at 2:54 AM, Miano Njoka wrote: > Yes, this is true, but why strip out the meta tag from the resulting HTML? Two reasons: 1. It may be incorrect. 2. If multiple templates are used to construct a response, different values may be included from each template, which may be i

Re: [Zope-dev] Content Type Meta tag stripping in zope.pagetemplate

2012-02-22 Thread Miano Njoka
On Wed, Feb 22, 2012 at 8:08 PM, Fred Drake wrote: > On Wed, Feb 22, 2012 at 10:28 AM, Miano Njoka wrote: >> > /> tags were being stripped out from ZPT templates. Is there a reason >> for this? > > As I recall, the rationale goes like this: > > 1. We're sniffing the input encoding from the charse

Re: [Zope-dev] Content Type Meta tag stripping in zope.pagetemplate

2012-02-22 Thread Fred Drake
On Wed, Feb 22, 2012 at 10:28 AM, Miano Njoka wrote: > /> tags were being stripped out from ZPT templates. Is there a reason > for this? As I recall, the rationale goes like this: 1. We're sniffing the input encoding from the charset setting. 2. We're storing the content-type on the instance (

[Zope-dev] Content Type Meta tag stripping in zope.pagetemplate

2012-02-22 Thread Miano Njoka
Hello all, I'm a fairly new zope developer, came across a "bug" in my application that tags were being stripped out from ZPT templates. Is there a reason for this? This is done in the _prepare_html function of zope.pagetemplate.pagetemplatefile.PageTemplateFile. My application produces XHTML that