cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Uyttenhove <jan.uyttenh...@xume.com>
Subject Re: [once again] best way to set http header encoding
Date Tue, 17 Feb 2004 00:00:44 GMT
> 
> 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.

> 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 :-)

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.

> 
> thanks and greetings
> stefan
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 
> 
> 

-- 
Jan Uyttenhove          jan.uyttenhove@xume.com	
 > Xume < - http://www.xume.com



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message