Re: [Zope-CMF] Charsets

2009-01-25 Thread Daniel Nouri
Charlie Clark writes: > Am 25.01.2009 um 08:35 schrieb Dieter Maurer: >> Of course, "iso-8859-1" may not be approriate for form delivery -- >> and may result in funny special characters in non-western countries. > > > As Daniel noted UTF-8 should be default. I had a quick look at the > source o

Re: [Zope-CMF] Charsets

2009-01-25 Thread Charlie Clark
Am 25.01.2009 um 08:35 schrieb Dieter Maurer: > Wow. Some magic in "formlib" deviating from the Zope2 standard > behaviour Maybe. But then formlib is not really a standard Zope 2 approach. The one thing I do find weird is that PreferredCharsets() is called for each field in a form. >

Re: [Zope-CMF] Charsets

2009-01-24 Thread Dieter Maurer
yuppie wrote at 2009-1-19 22:54 +0100: > ... >Products.Five.browser.decode.setPageEncoding sets the response content >type charset based on zope.publisher.http.HTTPCharsets. And >setPageEncoding is called by the update method of formlib forms in Zope >2. So in this case the response encoding has

Re: [Zope-CMF] Charsets

2009-01-21 Thread Charlie Clark
Am 21.01.2009 um 00:11 schrieb Daniel Nouri: > Is this thread by any chance related to this bug: > https://bugs.launchpad.net/zope2/+bug/160968 > > The IUserPreferredCharsets implementation of Zope 3 found in > zope.publisher.http.HTTPCharsets has the following condition in it > to check if th

Re: [Zope-CMF] Charsets

2009-01-20 Thread Daniel Nouri
Is this thread by any chance related to this bug: https://bugs.launchpad.net/zope2/+bug/160968 The IUserPreferredCharsets implementation of Zope 3 found in zope.publisher.http.HTTPCharsets has the following condition in it to check if the HTTP_ACCEPT_CHARSET header is available: heade

Re: [Zope-CMF] Charsets

2009-01-19 Thread yuppie
Dieter Maurer wrote: > yuppie wrote at 2009-1-19 11:32 +0100: >> Charlie Clark wrote: >>> Am 18.01.2009 um 23:00 schrieb yuppie: >>> I agree that there shouldn't be implemented in a different way than >>> for Zope 3. And if we can solve the problems by fixing form encoding >>> I'm happy. Althou

Re: [Zope-CMF] Charsets

2009-01-19 Thread Dieter Maurer
Charlie Clark wrote at 2009-1-18 22:30 +0100: >Am 18.01.2009 um 20:36 schrieb Dieter Maurer: > ... > From the current HTML specification: > >"accept-charset = charset list [CI] >This attribute specifies the list of character encodings for input >data that is accepted by the server processing this

Re: [Zope-CMF] Charsets

2009-01-19 Thread Dieter Maurer
yuppie wrote at 2009-1-19 11:32 +0100: >Charlie Clark wrote: >> Am 18.01.2009 um 23:00 schrieb yuppie: >> I agree that there shouldn't be implemented in a different way than >> for Zope 3. And if we can solve the problems by fixing form encoding >> I'm happy. Although I'd like to see UTF-8 alwa

Re: [Zope-CMF] Charsets

2009-01-19 Thread Charlie Clark
Am 19.01.2009 um 11:32 schrieb yuppie: > zope.publisher.http.HTTPCharsets explicitly prefers utf-8. Are you > sure > getPreferredCharsets()[0] is iso-8859-1 with your browser? Or do you > override somewhere the Content-Type header set by setPageEncoding()? > AFAICS CMFDefault works exactly the

Re: [Zope-CMF] Charsets

2009-01-19 Thread yuppie
Charlie Clark wrote: > Am 18.01.2009 um 23:00 schrieb yuppie: > I agree that there shouldn't be implemented in a different way than > for Zope 3. And if we can solve the problems by fixing form encoding > I'm happy. Although I'd like to see UTF-8 always the first charset > returned if * the q

Re: [Zope-CMF] Charsets

2009-01-19 Thread Charlie Clark
Am 18.01.2009 um 23:00 schrieb yuppie: > Hi Charlie! Hiya Yuppie, > Charlie Clark wrote: >> Am 29.12.2008 um 15:01 schrieb Charlie Clark: >> >> CMFDefault.utils >> >> def getBrowserCharset(request): >> """ Get charset preferred by the browser. >> """ >> envadapter = IUserPreferredCh

Re: [Zope-CMF] Charsets

2009-01-18 Thread yuppie
Hi Charlie! Charlie Clark wrote: > Am 29.12.2008 um 15:01 schrieb Charlie Clark: > > CMFDefault.utils > > def getBrowserCharset(request): > """ Get charset preferred by the browser. > """ > envadapter = IUserPreferredCharsets(request) > charsets = envadapter.getPreferredChar

Re: [Zope-CMF] Charsets

2009-01-18 Thread Charlie Clark
Am 18.01.2009 um 20:36 schrieb Dieter Maurer: > The "Accept-Charset" request header should *never* be used > to guess a charset at the server side: > > "Accept-Charset" is a user preference which does not know > anything about charsets used by the server. > > If "utf-8" would not be treated wit

Re: [Zope-CMF] Charsets

2009-01-18 Thread Dieter Maurer
Charlie Clark wrote at 2009-1-18 15:49 +0100: > ... >I would suggest that we work towards enforcing UTF-8 in where possible >but at the very least add the accept-charset attribute to forms and >use the portal's default_charset for this. > >I'd very much appreciate your comments on this. The "A

Re: [Zope-CMF] Charsets

2009-01-18 Thread Charlie Clark
Am 29.12.2008 um 15:01 schrieb Charlie Clark: >> The site should deliver all pages containing forms (if possible even >> all pages) with a single charset, let's call it the "site charset". >> Then it uses this same charset to interpret form data. > > > While I understand this, I'm a bit at a loss

Re: [Zope-CMF] Charsets

2008-12-29 Thread Charlie Clark
Am 19.12.2008 um 19:20 schrieb Dieter Maurer: >> Right. So I must be doing something wrong if all Zope has to go on >> for >> decoding the form is the Accept-Charset? How can I set an encoding >> for >> the form? > > The site should deliver all pages containing forms (if possible even > all p

Re: [Zope-CMF] Charsets

2008-12-19 Thread Dieter Maurer
Charlie Clark wrote at 2008-12-19 11:35 +0100: > ... >> Usually, the client will use the charset it has found in the >> page containing the form. Thus, unless this charset has been >> determined automatically from the "Accept-Charset" header, >> it is merely accidental when the client preferences (

Re: [Zope-CMF] Charsets

2008-12-19 Thread Charlie Clark
Am 15.12.2008 um 21:01 schrieb Dieter Maurer: > It is usually insane to use client preferences to guess the encoding > used in form data. Have to agree with you there. > Usually, the client will use the charset it has found in the > page containing the form. Thus, unless this charset has been >

Re: [Zope-CMF] Charsets

2008-12-15 Thread Dieter Maurer
Charlie Clark wrote at 2008-12-14 12:32 +0100: >Am 13.12.2008 um 18:40 schrieb Charlie Clark: > >> Hi, >> >> I'm struggling with the way formlib forms handle decoding from forms. >> It looks like this gets set in BrowserView using an >> IUserPreferredCharsets adapter. The default adapter seems to b

Re: [Zope-CMF] Charsets

2008-12-14 Thread Charlie Clark
Am 13.12.2008 um 18:40 schrieb Charlie Clark: > Hi, > > I'm struggling with the way formlib forms handle decoding from forms. > It looks like this gets set in BrowserView using an > IUserPreferredCharsets adapter. The default adapter seems to be in > zope.publisher.http and it looks like latin-1

[Zope-CMF] Charsets

2008-12-13 Thread Charlie Clark
Hi, I'm struggling with the way formlib forms handle decoding from forms. It looks like this gets set in BrowserView using an IUserPreferredCharsets adapter. The default adapter seems to be in zope.publisher.http and it looks like latin-1 will be set if there is no other charset and I'm ha