Jan Uyttenhove wrote:

i wonder that cocoons serializer just writes a meta-tag with the encoding in the html-page. it doesn't do this in the http-header.


therefore apache set the http-header to his standard-encoding and "destroys" the correct encoding of the response, because most browsers ignore the meta-tag if the http-header-encoding is set.


Do you mean Apache or Tomcat?
Tomcat sets the http header encoding to the default ISO-8859-1, if none specified. You can also set the addDefaultCharset in Apache, but that won't make any difference I think, as there's already an encoding specified by Tomcat.

---> i mean apache.
if i connect to tomcat directly theres no encoding set in the header, just the mime-type (i use tomcat 4.1.12 and ieHTTPHeaders for inspecting the header-data).
therefore my page with russian characters displays correct, because the browser uses the meta-tag in the html.


BUT if i connect via apache/jk2, apache uses the directive you mention to set a default encoding - and the encoding is "destroyed". if tomcat would set the header-encoding - you're absolutely right - apache would do noting.


so i need to set the http-header-encoding with cocoon and ask you all, whats the best way to do this. are there any actions, logicsheets or something else?


ATM, Cocoon set the meta content-type tag with the mime-type and the encoding of the serializer. Furthermore, response.setContentType *is* called, which is one of the ways to set the http encoding header. But it is called with argument mime-type only, e.g. response.setContentType("text/html"), and we should be able to do response.setContentType("text/html; charset=utf-8").
Actually, you can, if you change the mime-type of the serializer in the sitemap from e.g. 'text/html' to 'text/html; charset=utf-8', you'll see that the http header encoding has changed to utf-8. Just an illustration of the problem, not a very nice solution :-)

at the moment i'm happy by setting the apache-directive to utf-8 for my virtual-host, but this is another good way for a temporary solution :-)


We should be able to set the full content-type (with charset) in HttpEnvironment or in AbstractProcessingPipeline. I guess that involves changing at least the setSerializer(...) in AbstractProcessingPipeline and passing the encoding.

i will try to open a bugzilla issue for this like bruno dumon wrote, but first i need to search on the cocoon-page where i can do this :-)


thanks and greetings
stefan



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to