cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christopher Schultz (JIRA)" <>
Subject [jira] Commented: (COCOON-1049) encoding in Content-Type header is not set by serializers
Date Mon, 30 Jan 2006 20:57:33 GMT
    [ ] 

Christopher Schultz commented on COCOON-1049:

It turns out that there's a workaround for this problem (see below).

I had assumed that with a serializer such as:

<map:serializer mime-type="text/html" ...>

That the Content-Type would be set to mime-type + encoding --> "text/html; charset=UTF-8".
Apparently, the encoding only sets the charseter encoding for the Writer that the serializers
use, and the Content-Type is only set to the value of the "mime-type" attribute.

On a (despiration) hunch, I changed my serializer's mime-type to "text/html; charset=UTF-8"
and that worked. The attribute name, then, is misleading. It actually sets the entire content-type,
which is more than just the mime-type.

This fact should at least be indicated in the documentation. If it were, perhaps a code change
might not even be necessary, FWIW.

> encoding in Content-Type header is not set by serializers
> ---------------------------------------------------------
>          Key: COCOON-1049
>          URL:
>      Project: Cocoon
>         Type: Bug
>   Components: * Cocoon Core
>     Versions: 2.1.4
>  Environment: Operating System: All
> Platform: PC
>     Reporter: Stefan Burkard
>     Assignee: Cocoon Developers Team
>     Priority: Critical
>  Attachments: MimeType.patch.txt
> The Cocoon Serializer does not set the encoding in the HTTP-Header, it just sets
> the mime-type in the header. additionally, it writes a meta-tag with mime-type
> and encoding in the html. 
> if now any component (for example apache webserver) sets a (wrong) default
> encoding in the header, most browsers use this header-encoding and ignore the
> meta-tag-encoding. 
> --------------------------------------
> here is an answer from jan uyttenhove from the cocoon-users-group to my question
> regarding this issue. i think this could help the developer:
> 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").
> 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.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message