UTF-8 problem with zope2.10 and postgresql
Hello, I'm trying to upgrade my applications from debian sarge to debian lenny, so from zope2.7 to zope2.10. I've decided to have all in UTF-8 in my new server, which is the default for lenny, for postgresql also. The situation now is : In the database, all is OK If I create a ZSQL method (say sql_candidat) in the ZMI and test it, all is OK (example firstname : Andrée) If I create a dtml method, loop over my ZSQL method, and print the firstname, it's messed up. Example dtml: <dtml-in sql_candidat> <dtml-var firstname> </dtml-in> The result in the browser is : Andrée A contrario : In the page <input type="text" size="20" name="firstname:utf8:ustring" In the browser, I type Andrée, I click on submit, the data are saved through another ZSQL method (UPDATE SQl statement) and all is OK in the database In zope.conf: locale fr_FR.utf8 rest-input-encoding utf-8 rest-output-encoding utf-8 rest-language-code fr default-zpublisher-encoding utf-8 In the HTML page <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> The HTTP header (with liveHTTPheader in firefox) is correct : Content-Type: text/html; charset=utf-8 Any idea ? Claire Boussard.
Am 06.11.09 17:40, schrieb Claire Boussard:
In the HTML page <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
The ZPublisher does not care about that. You may set the content-type explictly as HTTP header and not through http-equiv by calling RESPONSE.setHeader(key, value) (no idea how to do that using the ancient technology DTML). -aj
----- Original Message ----- From: "Andreas Jung" <lists@zopyx.com> To: "Claire Boussard" <claibous2@free.fr> Cc: "zope" <zope@zope.org> Sent: Friday, November 06, 2009 12:47 PM Subject: Re: [Zope] UTF-8 problem with zope2.10 and postgresql
Am 06.11.09 17:40, schrieb Claire Boussard:
In the HTML page <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
The ZPublisher does not care about that. You may set the content-type explictly as HTTP header and not through http-equiv by calling
RESPONSE.setHeader(key, value)
(no idea how to do that using the ancient technology DTML).
<dtml-call "RESPONSE.setHeader('Content-Type','text/html; charset=UTF-8')"> DTML: Mature, stable, reliable. Jonathan
Am 06.11.09 19:00, schrieb Jonathan (dev101):
----- Original Message ----- From: "Andreas Jung" <lists@zopyx.com> To: "Claire Boussard" <claibous2@free.fr> Cc: "zope" <zope@zope.org> Sent: Friday, November 06, 2009 12:47 PM Subject: Re: [Zope] UTF-8 problem with zope2.10 and postgresql
Am 06.11.09 17:40, schrieb Claire Boussard:
In the HTML page <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
The ZPublisher does not care about that. You may set the content-type explictly as HTTP header and not through http-equiv by calling
RESPONSE.setHeader(key, value)
(no idea how to do that using the ancient technology DTML).
<dtml-call "RESPONSE.setHeader('Content-Type','text/html; charset=UTF-8')">
DTML: Mature, stable, reliable.
Technology for dinosaurs :-) SCNR Andreas
+-------[ Andreas Jung ]---------------------- | Am 06.11.09 19:00, schrieb Jonathan (dev101): | > ----- Original Message ----- | > From: "Andreas Jung" <lists@zopyx.com> | > To: "Claire Boussard" <claibous2@free.fr> | > Cc: "zope" <zope@zope.org> | > Sent: Friday, November 06, 2009 12:47 PM | > Subject: Re: [Zope] UTF-8 problem with zope2.10 and postgresql | > | > | > | >> Am 06.11.09 17:40, schrieb Claire Boussard: | >> | >>> In the HTML page | >>> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | >>> | >>> | >> The ZPublisher does not care about that. You may set the content-type | >> explictly as HTTP header and not through http-equiv by calling | >> | >> RESPONSE.setHeader(key, value) | >> | >> (no idea how to do that using the ancient technology DTML). | >> | > | > <dtml-call "RESPONSE.setHeader('Content-Type','text/html; charset=UTF-8')"> | > | > DTML: Mature, stable, reliable. | > | Technology for dinosaurs :-) Takes an extinction level event to wipe out dinosaurs... as opposed to a bit of a heat increase for lowly mammals d8) -- Andrew Milton akm@theinternet.com.au
Andrew Milton wrote:
+-------[ Andreas Jung ]---------------------- | Am 06.11.09 19:00, schrieb Jonathan (dev101): | > ----- Original Message ----- | > From: "Andreas Jung" <lists@zopyx.com> | > To: "Claire Boussard" <claibous2@free.fr> | > Cc: "zope" <zope@zope.org> | > Sent: Friday, November 06, 2009 12:47 PM | > Subject: Re: [Zope] UTF-8 problem with zope2.10 and postgresql | > | > | > | >> Am 06.11.09 17:40, schrieb Claire Boussard: | >> | >>> In the HTML page | >>> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | >>> | >>> | >> The ZPublisher does not care about that. You may set the content-type | >> explictly as HTTP header and not through http-equiv by calling | >> | >> RESPONSE.setHeader(key, value) | >> | >> (no idea how to do that using the ancient technology DTML). | >> | > | > <dtml-call "RESPONSE.setHeader('Content-Type','text/html; charset=UTF-8')"> | > | > DTML: Mature, stable, reliable. | > | Technology for dinosaurs :-)
Takes an extinction level event to wipe out dinosaurs... as opposed to a bit of a heat increase for lowly mammals d8)
I've always been amused by this 'outdated' technology thing, with respect to dtml. Someone had better tell Linus to change his programming language for the kernel, it's getting a bit old by now. How about c#, that should do it. Garry
Garry Saddington wrote:
I've always been amused by this 'outdated' technology thing, with respect to dtml. Someone had better tell Linus to change his programming language for the kernel, it's getting a bit old by now. How about c#, that should do it.
Comparing C and DTML is pretty rediculous. Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk
Chris Withers wrote:
Garry Saddington wrote:
I've always been amused by this 'outdated' technology thing, with respect to dtml. Someone had better tell Linus to change his programming language for the kernel, it's getting a bit old by now. How about c#, that should do it.
Comparing C and DTML is pretty rediculous.
Chris
It wasn't a comparison, it was a 'ridiculous' tongue in cheek analogy. There are plenty more if you would like;-) The point is that stating something is old or outdated is not a reason to prove its utility or otherwise.
2009/11/6 Garry Saddington <garry@schoolteachers.co.uk>:
I've always been amused by this 'outdated' technology thing, with respect to dtml. Someone had better tell Linus to change his programming language for the kernel, it's getting a bit old by now. How about c#, that should do it.
It's a question of resources and maintainability. Few people have the time or the inclination to keep DTML going. Ergo, it'll die and we let you know so you can migrate away from it. -- Martijn Pieters
Am 06.11.09 22:16, schrieb Allen Schmidt Sr.:
Well if DTML ever is taken out of a Zope release, that will be the end of Zope for us, and others I am sure. There are no plans for taking DTML out of Zope. But there are also no plans for keeping you away from using DTML :-) ZPT is the way to go...if you you are using DTML then your own pain, risk and pleasure.
Andreas
+-------[ Martijn Pieters ]---------------------- | | 2009/11/6 Garry Saddington <garry@schoolteachers.co.uk>: | > I've always been amused by this 'outdated' technology thing, with | > respect to dtml. Someone had better tell Linus to change his programming | > language for the kernel, it's getting a bit old by now. How about c#, | > that should do it. | | It's a question of resources and maintainability. Few people have the | time or the inclination to keep DTML going. Ergo, it'll die and we let | you know so you can migrate away from it. More likely, someone spiteful will deliberately break it or simply remove it between releases without notice, that seems to be the "Zope Way" -- Andrew Milton akm@theinternet.com.au
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Andrew Milton wrote:
+-------[ Martijn Pieters ]---------------------- | | 2009/11/6 Garry Saddington <garry@schoolteachers.co.uk>: | > I've always been amused by this 'outdated' technology thing, with | > respect to dtml. Someone had better tell Linus to change his programming | > language for the kernel, it's getting a bit old by now. How about c#, | > that should do it. | | It's a question of resources and maintainability. Few people have the | time or the inclination to keep DTML going. Ergo, it'll die and we let | you know so you can migrate away from it.
More likely, someone spiteful will deliberately break it or simply remove it between releases without notice, that seems to be the "Zope Way"
Really? When have we deliberately broken stuff between releases without notice? We've been pretty damned careful about BBB issues, AFAIK. Tres. - -- =================================================================== Tres Seaver +1 540-429-0999 tseaver@palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkr18KQACgkQ+gerLs4ltQ4qNACfeBGq7mvT8wdSdNWM4fKHuaBJ yjQAoKxis7aBSuJUqckLQve7WwZPpWOM =6NoB -----END PGP SIGNATURE-----
Am 07.11.09 23:11, schrieb Tres Seaver:
Andrew Milton wrote:
+-------[ Martijn Pieters ]---------------------- | | 2009/11/6 Garry Saddington <garry@schoolteachers.co.uk>: | > I've always been amused by this 'outdated' technology thing, with | > respect to dtml. Someone had better tell Linus to change his programming | > language for the kernel, it's getting a bit old by now. How about c#, | > that should do it. | | It's a question of resources and maintainability. Few people have the | time or the inclination to keep DTML going. Ergo, it'll die and we let | you know so you can migrate away from it.
More likely, someone spiteful will deliberately break it or simply remove it between releases without notice, that seems to be the "Zope Way"
Really? When have we deliberately broken stuff between releases without notice? We've been pretty damned careful about BBB issues, AFAIK. Absolutely right.
Andreas
+-------[ Tres Seaver ]---------------------- | -----BEGIN PGP SIGNED MESSAGE----- | Hash: SHA1 | | Andrew Milton wrote: | > +-------[ Martijn Pieters ]---------------------- | > | | > | 2009/11/6 Garry Saddington <garry@schoolteachers.co.uk>: | > | > I've always been amused by this 'outdated' technology thing, with | > | > respect to dtml. Someone had better tell Linus to change his programming | > | > language for the kernel, it's getting a bit old by now. How about c#, | > | > that should do it. | > | | > | It's a question of resources and maintainability. Few people have the | > | time or the inclination to keep DTML going. Ergo, it'll die and we let | > | you know so you can migrate away from it. | > | > More likely, someone spiteful will deliberately break it or simply | > remove it between releases without notice, that seems to be the "Zope | > Way" | | Really? When have we deliberately broken stuff between releases without | notice? We've been pretty damned careful about BBB issues, AFAIK. I don't really want to fill up an email with a litany of stuff, I'm sure many people have their own pet-peeves about stuff being axed out, but, I'll give you one. PageTemplateFile stops Zope from starting if the file they refer to does not exist, rather than the 'at-access-time' error they used to generate. When you have place holder code and templates in abstract base-classes, this sucks the big one let me tell you. -- Andrew Milton akm@theinternet.com.au
2009/11/8 Andrew Milton <akm@theinternet.com.au>:
PageTemplateFile stops Zope from starting if the file they refer to does not exist, rather than the 'at-access-time' error they used to generate. When you have place holder code and templates in abstract base-classes, this sucks the big one let me tell you.
I don't know why or what changed there, but have you considered that this could be a bug? It sounds as if you have a legitimate usecase there, at least something you could argue convincingly about. -- Martijn Pieters
+-------[ Jonathan (dev101) ]---------------------- | | ----- Original Message ----- | From: "Andreas Jung" <lists@zopyx.com> | To: "Claire Boussard" <claibous2@free.fr> | Cc: "zope" <zope@zope.org> | Sent: Friday, November 06, 2009 12:47 PM | Subject: Re: [Zope] UTF-8 problem with zope2.10 and postgresql | | | > Am 06.11.09 17:40, schrieb Claire Boussard: | >> | >> In the HTML page | >> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | >> | > The ZPublisher does not care about that. You may set the content-type | > explictly as HTTP header and not through http-equiv by calling | > | > RESPONSE.setHeader(key, value) | > | > (no idea how to do that using the ancient technology DTML). | | | <dtml-call "RESPONSE.setHeader('Content-Type','text/html; charset=UTF-8')"> | | DTML: Mature, stable, reliable. + predictable... -- Andrew Milton akm@theinternet.com.au
participants (9)
-
Allen Schmidt Sr. -
Andreas Jung -
Andrew Milton -
Chris Withers -
Claire Boussard -
Garry Saddington -
Jonathan (dev101) -
Martijn Pieters -
Tres Seaver