Hi All, I want to change the output encoding of a DTML Method based on a session variable. But unfortunately the code below doesn't work. The client Mozilla/IE presents the page as standard ISO-8859-1, even is the meta tag is set to ISO-8859-9. Any suggestions? Greetings Ralph <dtml-if "get_session_language_code() == 'tr'"> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-9"> <dtml-call "RESPONSE.setHeader('Content-Type', 'text/html; charset=ISO-8859-9')"> <dtml-else> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <dtml-call "RESPONSE.setHeader('Content-Type', 'text/html; charset=ISO-8859-1')"> </dtml-if>
From: "Ralph van den Houdt" <ralph@ezcompany.nl>
I want to change the output encoding of a DTML Method based on a session variable. But unfortunately the code below doesn't work. The client Mozilla/IE presents the page as standard ISO-8859-1, even is the meta tag is set to ISO-8859-9.
Any suggestions?
Greetings Ralph
<dtml-if "get_session_language_code() == 'tr'"> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-9"> <dtml-call "RESPONSE.setHeader('Content-Type', 'text/html; charset=ISO-8859-9')"> <dtml-else> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <dtml-call "RESPONSE.setHeader('Content-Type', 'text/html; charset=ISO-8859-1')"> </dtml-if>
Perhaps a silly question, but... Have you confirmed that your <dtml-if "get_session_language_code() == 'tr'"> is evaluating to TRUE? Jonathan
Hi Jonathan, I checked as mentioned:
even if the meta tag is set to ISO-8859-9.
The evaluation returns true and sets the meta tag and writes to the response. But the client doesn't care about it. Greetings Ralph PS: There are no silly questions, only stupid answers. Jonathan Hobbs wrote:
From: "Ralph van den Houdt" <ralph@ezcompany.nl>
I want to change the output encoding of a DTML Method based on a session variable. But unfortunately the code below doesn't work. The client Mozilla/IE presents the page as standard ISO-8859-1, even is the meta tag is set to ISO-8859-9.
Any suggestions?
Greetings Ralph
<dtml-if "get_session_language_code() == 'tr'"> <meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-9">
<dtml-call "RESPONSE.setHeader('Content-Type', 'text/html; charset=ISO-8859-9')"> <dtml-else> <meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<dtml-call "RESPONSE.setHeader('Content-Type', 'text/html; charset=ISO-8859-1')"> </dtml-if>
Perhaps a silly question, but...
Have you confirmed that your <dtml-if "get_session_language_code() == 'tr'"> is evaluating to TRUE?
Jonathan
From: "Ralph van den Houdt" <ralph@ezcompany.nl>
I checked as mentioned:
even if the meta tag is set to ISO-8859-9.
The evaluation returns true and sets the meta tag and writes to the response. But the client doesn't care about it.
Greetings Ralph
PS: There are no silly questions, only stupid answers.
Jonathan Hobbs wrote:
From: "Ralph van den Houdt" <ralph@ezcompany.nl>
I want to change the output encoding of a DTML Method based on a session variable. But unfortunately the code below doesn't work. The client Mozilla/IE presents the page as standard ISO-8859-1, even is the meta tag is set to ISO-8859-9.
Any suggestions?
Greetings Ralph
<dtml-if "get_session_language_code() == 'tr'"> <meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-9">
<dtml-call "RESPONSE.setHeader('Content-Type', 'text/html; charset=ISO-8859-9')"> <dtml-else> <meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<dtml-call "RESPONSE.setHeader('Content-Type', 'text/html; charset=ISO-8859-1')"> </dtml-if>
Perhaps a silly question, but...
Have you confirmed that your <dtml-if "get_session_language_code() ==
'tr'">
is evaluating to TRUE?
How about using a utility which would allow you to use http to access your dtml method and then examine the headers (ie. Curl, wget, etc) to see if they are being set correctly. That would let you know if: 1) they are being set correctly and are then just ignored by your client, or 2) they are not being set, so either something in zope or something in front of zope (ie. if you are running apache or something similar) is messing with the headers Jonathan
Hi Jonathan, Sorry my fault, an included file resetted the Response to ISO-8859-1 Greetings Ralph ----- Original Message ----- From: "Jonathan Hobbs" <toolkit@magma.ca> To: "Ralph van den Houdt" <ralph@ezcompany.nl> Cc: <zope@zope.org> Sent: Thursday, September 30, 2004 4:47 PM Subject: Re: [Zope] Dynamic output encoding
From: "Ralph van den Houdt" <ralph@ezcompany.nl>
I checked as mentioned:
even if the meta tag is set to ISO-8859-9.
The evaluation returns true and sets the meta tag and writes to the response. But the client doesn't care about it.
Greetings Ralph
PS: There are no silly questions, only stupid answers.
Jonathan Hobbs wrote:
From: "Ralph van den Houdt" <ralph@ezcompany.nl>
I want to change the output encoding of a DTML Method based on a session variable. But unfortunately the code below doesn't work. The client Mozilla/IE presents the page as standard ISO-8859-1, even is the meta tag is set to ISO-8859-9.
Any suggestions?
Greetings Ralph
<dtml-if "get_session_language_code() == 'tr'"> <meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-9">
<dtml-call "RESPONSE.setHeader('Content-Type', 'text/html; charset=ISO-8859-9')"> <dtml-else> <meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<dtml-call "RESPONSE.setHeader('Content-Type', 'text/html; charset=ISO-8859-1')"> </dtml-if>
Perhaps a silly question, but...
Have you confirmed that your <dtml-if "get_session_language_code() ==
'tr'">
is evaluating to TRUE?
How about using a utility which would allow you to use http to access your dtml method and then examine the headers (ie. Curl, wget, etc) to see if they are being set correctly. That would let you know if:
1) they are being set correctly and are then just ignored by your client, or
2) they are not being set, so either something in zope or something in front of zope (ie. if you are running apache or something similar) is messing with the headers
Jonathan
_______________________________________________ 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 )
participants (3)
-
Jonathan Hobbs -
Ralph van den Houdt -
Ralph vd Houdt