Re: [Zope] charset problems (utf-8)
Hi Miguel, Yes, as I wrote in my first email, all encoding options in zope.conf are set to utf-8... On Thu, Feb 9, 2012 at 9:13 PM, Miguel Beltran R. yourpa...@gmail.com wrote: 2012/2/6 Hugo Ramos ram...@gmail.com But this doesn't seem to be the problem because templates encoded as utf-8 or iso-8859-1 all have the same problem. Any more ideas? are you played witth default-zpublisher-encoding option in zope.conf? Lo bueno de vivir un dia mas es saber que nos queda un dia menos de vida -- Hugo Ramos - IT Project Manager E: ram...@gmail.com W: www.hugoramos.eu Nobody expects the Spanish Inquisition! - Monty Python's Para visualizar este email em 3D, bata com uma bola de snooker na testa e fixe o ecrã durante 5 minutos a uma distância de 20cm. ___ Zope maillist - Zope@zope.org https://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] charset problems (utf-8)
2012/2/6 Hugo Ramos ram...@gmail.com But this doesn't seem to be the problem because templates encoded as utf-8 or iso-8859-1 all have the same problem. Any more ideas? are you played witth *default-zpublisher-encoding* option in zope.conf? Lo bueno de vivir un dia mas es saber que nos queda un dia menos de vida ___ Zope maillist - Zope@zope.org https://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] charset problems (utf-8)
I guess no one has charset problems... On Thu, Feb 2, 2012 at 6:06 PM, Hugo Ramos ram...@gmail.com wrote: Yellow, I've noticed charset problems displaying HTML pages. Let's say I want to display a page using a DTML Method like this: html head ... /head body á Á à À ç /body /html This page is ok and I can see the portuguese letters fine. The problem starts when I do this: html head ... /head body á Á à À ç br dtml-var sometextfield /body /html The first line of characters shows some strange characters and the sometextfield shows up fine even if it has the same portuguese characters. sometextfield comes from a mySQL server using utf-8 as charset and collation. zope.conf has the following: rest-input-encoding utf-8 rest-output-encoding utf-8 The browsers also have UTF-8 as the encoding (safari, firefox and chrome) all show me the same problem. I also noticed some strange behavior... If I create á Á à À ç as a property field using ustring and call it as dtml-var someproperty also gets fine in the browser. Anyone seen this??? Double encoding maybe??? TIA -- Hugo Ramos - IT Project Manager E: ram...@gmail.com W: www.hugoramos.eu Nobody expects the Spanish Inquisition! - Monty Python's Para visualizar este email em 3D, bata com uma bola de snooker na testa e fixe o ecrã durante 5 minutos a uma distância de 20cm. -- Hugo Ramos - IT Project Manager E: ram...@gmail.com W: www.hugoramos.eu Nobody expects the Spanish Inquisition! - Monty Python's Para visualizar este email em 3D, bata com uma bola de snooker na testa e fixe o ecrã durante 5 minutos a uma distância de 20cm. ___ Zope maillist - Zope@zope.org https://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] charset problems (utf-8)
Hi, You have to make sure that everything has the same encoding (strings, text values). I recomend you to convert everything to unicode and then put something like below as a first line in your page: span tal:replace=python:request.RESPONSE.setHeader('content-type','text/html;charset=utf-8') / and in the HEAD meta http-equiv=Content-Type content=text/html; charset=utf-8 / HTH, Dragos On Mon, Feb 6, 2012 at 2:38 PM, Hugo Ramos ram...@gmail.com wrote: I guess no one has charset problems... On Thu, Feb 2, 2012 at 6:06 PM, Hugo Ramos ram...@gmail.com wrote: Yellow, I've noticed charset problems displaying HTML pages. Let's say I want to display a page using a DTML Method like this: html head ... /head body á Á à À ç /body /html This page is ok and I can see the portuguese letters fine. The problem starts when I do this: html head ... /head body á Á à À ç br dtml-var sometextfield /body /html The first line of characters shows some strange characters and the sometextfield shows up fine even if it has the same portuguese characters. sometextfield comes from a mySQL server using utf-8 as charset and collation. zope.conf has the following: rest-input-encoding utf-8 rest-output-encoding utf-8 The browsers also have UTF-8 as the encoding (safari, firefox and chrome) all show me the same problem. I also noticed some strange behavior... If I create á Á à À ç as a property field using ustring and call it as dtml-var someproperty also gets fine in the browser. Anyone seen this??? Double encoding maybe??? TIA -- Hugo Ramos - IT Project Manager E: ram...@gmail.com W: www.hugoramos.eu Nobody expects the Spanish Inquisition! - Monty Python's Para visualizar este email em 3D, bata com uma bola de snooker na testa e fixe o ecrã durante 5 minutos a uma distância de 20cm. -- Hugo Ramos - IT Project Manager E: ram...@gmail.com W: www.hugoramos.eu Nobody expects the Spanish Inquisition! - Monty Python's Para visualizar este email em 3D, bata com uma bola de snooker na testa e fixe o ecrã durante 5 minutos a uma distância de 20cm. ___ Zope maillist - Zope@zope.org https://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope-dev ) -- Dragos Chirila objectval...@gmail.com (+4) 0722 395375 ___ Zope maillist - Zope@zope.org https://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] charset problems (utf-8)
The correct prefix in the HTML header (meta http-equiv=Content-Type content=text/html; charset=utf-8 is not needed because it affects the browser behavior only and all my 3 browsers are set to UTF-8 by default. I've checked and I have some templates encoded as utf-8 and others as iso-8859-1. This happens because some of the templates (mainly the ones encoded as iso-8859-1) come from old data.fs that I've upgraded and maintained over the years... But this doesn't seem to be the problem because templates encoded as utf-8 or iso-8859-1 all have the same problem. Any more ideas? BTW, any1 knows about some script I can use to encode everything in my data.fs to utf-8? That would be very useful! On Mon, Feb 6, 2012 at 2:16 PM, Thierry Florac thierry.flo...@onf.fr wrote: Hi, As a french, I had many charset problems at first because of our accentuated characters... But your problems are quite strange if everything is encoded in UTF-8. Do you have the correct prefix in your HTML template as well as the correct HTTP headers ? Can you check that your template is really encoded in UTF-8 ?? Regards, Thierry Le Mon, 06 Feb 2012 12:38:22 +, Hugo Ramos ram...@gmail.com a écrit: I guess no one has charset problems... On Thu, Feb 2, 2012 at 6:06 PM, Hugo Ramos ram...@gmail.com wrote: Yellow, I've noticed charset problems displaying HTML pages. Let's say I want to display a page using a DTML Method like this: html head ... /head body á Á à À ç /body /html This page is ok and I can see the portuguese letters fine. The problem starts when I do this: html head ... /head body á Á à À ç br dtml-var sometextfield /body /html The first line of characters shows some strange characters and the sometextfield shows up fine even if it has the same portuguese characters. sometextfield comes from a mySQL server using utf-8 as charset and collation. zope.conf has the following: rest-input-encoding utf-8 rest-output-encoding utf-8 The browsers also have UTF-8 as the encoding (safari, firefox and chrome) all show me the same problem. I also noticed some strange behavior... If I create á Á à À ç as a property field using ustring and call it as dtml-var someproperty also gets fine in the browser. Anyone seen this??? Double encoding maybe??? TIA -- Hugo Ramos - IT Project Manager E: ram...@gmail.com W: www.hugoramos.eu Nobody expects the Spanish Inquisition! - Monty Python's Para visualizar este email em 3D, bata com uma bola de snooker na testa e fixe o ecrã durante 5 minutos a uma distância de 20cm. -- Hugo Ramos - IT Project Manager E: ram...@gmail.com W: www.hugoramos.eu Nobody expects the Spanish Inquisition! - Monty Python's Para visualizar este email em 3D, bata com uma bola de snooker na testa e fixe o ecrã durante 5 minutos a uma distância de 20cm. ___ Zope maillist - Zope@zope.org https://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] charset problems (utf-8)
Is there any tool I can use to convert all objects in my data.fs to utf-8? On Mon, Feb 6, 2012 at 3:24 PM, Dragos Chirila objectval...@gmail.com wrote: Hi, You have to make sure that everything has the same encoding (strings, text values). I recomend you to convert everything to unicode and then put something like below as a first line in your page: span tal:replace=python:request.RESPONSE.setHeader('content-type','text/html;charset=utf-8') / and in the HEAD meta http-equiv=Content-Type content=text/html; charset=utf-8 / HTH, Dragos On Mon, Feb 6, 2012 at 2:38 PM, Hugo Ramos ram...@gmail.com wrote: I guess no one has charset problems... On Thu, Feb 2, 2012 at 6:06 PM, Hugo Ramos ram...@gmail.com wrote: Yellow, I've noticed charset problems displaying HTML pages. Let's say I want to display a page using a DTML Method like this: html head ... /head body á Á à À ç /body /html This page is ok and I can see the portuguese letters fine. The problem starts when I do this: html head ... /head body á Á à À ç br dtml-var sometextfield /body /html The first line of characters shows some strange characters and the sometextfield shows up fine even if it has the same portuguese characters. sometextfield comes from a mySQL server using utf-8 as charset and collation. zope.conf has the following: rest-input-encoding utf-8 rest-output-encoding utf-8 The browsers also have UTF-8 as the encoding (safari, firefox and chrome) all show me the same problem. I also noticed some strange behavior... If I create á Á à À ç as a property field using ustring and call it as dtml-var someproperty also gets fine in the browser. Anyone seen this??? Double encoding maybe??? TIA -- Hugo Ramos - IT Project Manager E: ram...@gmail.com W: www.hugoramos.eu Nobody expects the Spanish Inquisition! - Monty Python's Para visualizar este email em 3D, bata com uma bola de snooker na testa e fixe o ecrã durante 5 minutos a uma distância de 20cm. -- Hugo Ramos - IT Project Manager E: ram...@gmail.com W: www.hugoramos.eu Nobody expects the Spanish Inquisition! - Monty Python's Para visualizar este email em 3D, bata com uma bola de snooker na testa e fixe o ecrã durante 5 minutos a uma distância de 20cm. ___ Zope maillist - Zope@zope.org https://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope-dev ) -- Dragos Chirila objectval...@gmail.com (+4) 0722 395375 -- Hugo Ramos - IT Project Manager E: ram...@gmail.com W: www.hugoramos.eu Nobody expects the Spanish Inquisition! - Monty Python's Para visualizar este email em 3D, bata com uma bola de snooker na testa e fixe o ecrã durante 5 minutos a uma distância de 20cm. ___ Zope maillist - Zope@zope.org https://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] charset problems (utf-8)
On 02/06/2012 04:59 PM, Hugo Ramos wrote: Is there any tool I can use to convert all objects in my data.fs to utf-8? I had unicode related problems which usually come from mixing different encodings. In my case pretty much all my data also comes from a relational database. Also, not all versions of Zope support unicode properly for all types of objects. I had problems trying to upgrade my data.fs between zope versions due to unicode issues. I don't recall all the situations I came through and I can't help you much more here. So, I guess your issue is that your page templates are combining data from other zope objects which are in different encoding. I doubt that you can convert all your objects to the same encoding as a general rule because that will be dependent on the specific object implementation. Even if you convert the data part of the objects, the code might still not work properly. But I don't know which type of objects you are talking about. Maybe one approach would be to export your data.fs as a whole or in parts using XML format and then try to make sure its encoding is utf-8. Just vague considerations and a long shot, sorry if it doesn't help. Regards, Fernando ___ Zope maillist - Zope@zope.org https://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Charset
Hello everybody, I change the file manage.dtml in ..\python\app\dtml. This is the change I've done: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN http://www.w3.org/TR/REC-html40/loose.dtd; html head meta http-equiv=content-type content=text/html;charset=utf-8 / titleZope on dtml-BASE0;/title Best regards. Jean Tinguely. Selon Tino Wildenhain [EMAIL PROTECTED]: Am Donnerstag, den 28.04.2005, 15:48 +0200 schrieb Daniel Dekany: Thursday, April 28, 2005, 3:11:01 PM, Peter Eis wrote: [EMAIL PROTECTED] wrote: Hello the list, In Zope.conf ( ZOPE 2.7.5-final ) I changed rest-input-encoding and rest-output-encoding to send UTF-8 and then restarted the server. But in my webbrowser, the files are always received in windows-1252. Do you access zope directly or are you running behind a web server like apache? In the latter you'll have to change the default encoding in the apache config, too. Out of curiosity: How is that? I would think that Zope creates the whole HTTP response (so including the Content-Type: text/html;charset=utf-8 header). OK, mod proxy and such may change some headers in it, but the Content-Type's charset? The charset is about the HTTP response body, which is surely created inside Zope. Yes. Its entirely Zopes job. And if you are using pure Zope, you need to set the header in the publish process, e.g. with a python script or something you use for default display. Also you need to set a property manage_page_charset in zopes root to be able to use that encoding in ZMI too. This way you arent storing unicode - only utf-8 as you want to display it. Regards Tino -- Tino Wildenhain [EMAIL PROTECTED] ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) This message was sent using IMP, the Internet Messaging Program. ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Charset
Am Montag, den 02.05.2005, 09:43 +0200 schrieb [EMAIL PROTECTED]: Hello everybody, I change the file manage.dtml in ..\python\app\dtml. This is the change I've done: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN http://www.w3.org/TR/REC-html40/loose.dtd; html head meta http-equiv=content-type content=text/html;charset=utf-8 / titleZope on dtml-BASE0;/title Yes, thats a common problem - true HTTP-headers always override these meta headers. Unfortunately file based approach leaves you and most tools with the meta tags to transport encoding accross different file based tools. In Zope you should simply: dtml-call expr=RESPONSE.setHeader('content-type','text/html; charset=utf-8') somewhere in the header and probably skipp the meta tag (or have it at least the same content) HTH Tino ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Charset
[EMAIL PROTECTED] wrote: Hello the list, In Zope.conf ( ZOPE 2.7.5-final ) I changed rest-input-encoding and rest-output-encoding to send UTF-8 and then restarted the server. But in my webbrowser, the files are always received in windows-1252. Do you access zope directly or are you running behind a web server like apache? In the latter you'll have to change the default encoding in the apache config, too. Peter -- ___ Dr. HagenPartner GmbH Am Weichselgarten 7 91058 Erlangen Tel: (0049)9131/691-330 Fax: (0049)9131/691-248 ___ ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Charset
Hello, I reach my ZOPE server directly. Best regards. Jean Tinguely. Selon Peter Eis [EMAIL PROTECTED]: [EMAIL PROTECTED] wrote: Hello the list, In Zope.conf ( ZOPE 2.7.5-final ) I changed rest-input-encoding and rest-output-encoding to send UTF-8 and then restarted the server. But in my webbrowser, the files are always received in windows-1252. Do you access zope directly or are you running behind a web server like apache? In the latter you'll have to change the default encoding in the apache config, too. Peter -- ___ Dr. HagenPartner GmbH Am Weichselgarten 7 91058 Erlangen Tel: (0049)9131/691-330 Fax: (0049)9131/691-248 ___ This message was sent using IMP, the Internet Messaging Program. ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Charset
Thursday, April 28, 2005, 3:11:01 PM, Peter Eis wrote: [EMAIL PROTECTED] wrote: Hello the list, In Zope.conf ( ZOPE 2.7.5-final ) I changed rest-input-encoding and rest-output-encoding to send UTF-8 and then restarted the server. But in my webbrowser, the files are always received in windows-1252. Do you access zope directly or are you running behind a web server like apache? In the latter you'll have to change the default encoding in the apache config, too. Out of curiosity: How is that? I would think that Zope creates the whole HTTP response (so including the Content-Type: text/html;charset=utf-8 header). OK, mod proxy and such may change some headers in it, but the Content-Type's charset? The charset is about the HTTP response body, which is surely created inside Zope. Peter -- Best regards, Daniel Dekany ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Charset
Daniel Dekany wrote: Thursday, April 28, 2005, 3:11:01 PM, Peter Eis wrote: [EMAIL PROTECTED] wrote: Hello the list, In Zope.conf ( ZOPE 2.7.5-final ) I changed rest-input-encoding and rest-output-encoding to send UTF-8 and then restarted the server. But in my webbrowser, the files are always received in windows-1252. Do you access zope directly or are you running behind a web server like apache? In the latter you'll have to change the default encoding in the apache config, too. Out of curiosity: How is that? I would think that Zope creates the whole HTTP response (so including the Content-Type: text/html;charset=utf-8 header). OK, mod proxy and such may change some headers in it, but the Content-Type's charset? The charset is about the HTTP response body, which is surely created inside Zope. Right, the page itself will be delivered in uft-8. When we connected directly to zope the encoding was set to utf-8. It's just that if you're using Apache in front of zope the browser switches to the encoding which Apache is set to. After we changed the default character set from ISO-8859-1 to utf-8 the browser automatically changed it's character encoding to utf-8. Peter -- ___ Dr. HagenPartner GmbH Am Weichselgarten 7 91058 Erlangen Tel: (0049)9131/691-330 Fax: (0049)9131/691-248 ___ ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Charset
Am Donnerstag, den 28.04.2005, 15:48 +0200 schrieb Daniel Dekany: Thursday, April 28, 2005, 3:11:01 PM, Peter Eis wrote: [EMAIL PROTECTED] wrote: Hello the list, In Zope.conf ( ZOPE 2.7.5-final ) I changed rest-input-encoding and rest-output-encoding to send UTF-8 and then restarted the server. But in my webbrowser, the files are always received in windows-1252. Do you access zope directly or are you running behind a web server like apache? In the latter you'll have to change the default encoding in the apache config, too. Out of curiosity: How is that? I would think that Zope creates the whole HTTP response (so including the Content-Type: text/html;charset=utf-8 header). OK, mod proxy and such may change some headers in it, but the Content-Type's charset? The charset is about the HTTP response body, which is surely created inside Zope. Yes. Its entirely Zopes job. And if you are using pure Zope, you need to set the header in the publish process, e.g. with a python script or something you use for default display. Also you need to set a property manage_page_charset in zopes root to be able to use that encoding in ZMI too. This way you arent storing unicode - only utf-8 as you want to display it. Regards Tino -- Tino Wildenhain [EMAIL PROTECTED] ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )