cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Steinborn <thomas.steinb...@exceloncorp.com>
Subject encoding/locale of page response: bug!?
Date Wed, 05 Apr 2000 12:52:52 GMT
Hi,

I'm using cocoon 1.7.

I'm running into trouble right now, because the encoding of the response
send to an request does not set the character encoding/locale according
to the formatter used.

An example might make clear what I mean.

I'm serving an XML document on UTF-8 encoding. It contains some non
US-ASCII characters e.g. German Umlaute (üöä).

While withing the producer/processor/formatter cycle there is no
problem, since Java Strings are Unicode based.

But later, when we write the response in org.apache.cocoon.Engine#handle
cocoon simply does:

            // get the output writer
            PrintWriter out = response.getWriter();

            // send the page
            out.println(page.getContent());

This causes a problem, because it simply writes the content in the "...
platform's default character encoding..." (Quote form JDK doc).

Instead it should write it in the very same encoding as the formatter
used, e.g. in UTF-8 if the XML formatter is used or ISO-8859-1 if the
HTML formatter is used.

This is probalby more important for an XML result since the encoding
information in the <?xml ...?> header takes precedence of the encoding
given via the HTPP header.

In my opinion this is a bug. What do you think?

Any idea how to fix that?

Thanks
Thomas

Mime
View raw message