cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <stef...@apache.org>
Subject Re: Encoding problems
Date Wed, 15 Mar 2000 11:16:02 GMT
MORÁVEK Peter wrote:
> 
> COFIGURATION:
> WinNT 4.0, Apache 1.3.9, JServ 1.1, Java 1.2.2,
> Cocoon 1.7, Xalan 0.20.0, Xerces 1.0.2
> 
> Hello,
> 
> I haveproblems with encodings. I use ISO-8859-2 to support
> Slovak Characters in my html (through xml->xslt->html) output.
> Input is read from a file with ISO-8859-2 characters,
> but the only response I receive in html for some characters
> is th question character (?).
> 
> I've looked through the source code for Cocoon and I've found
> this in the org.apache.cocoon.producer.ProducerFromFile class:
> 
> 
> public Reader getStream(HttpServletRequest request) throws IOException {
>   File file = new File(Utils.getBasename(request, this.context));
>   this.monitor.watch(Utils.encode(request), file);
>   return new InputStreamReader(new FileInputStream(file)); // <-- WRONG
> }
> 
> I think, there should be:
> 
>   return new InputStreamReader(new FileInputStream(file),
>     encoding); // <-- CORRECT
> 
> So I can anywhere in cocoon.properties set the encoding for the
> input stream.
> 
> Any suggestions ?

This is already planned for Cocoon2.

Pier, make sure you are encoding-safe in the URL generator.

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<stefano@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Come to the first official Apache Software Foundation Conference!  
------------------------- http://ApacheCon.Com ---------------------



Mime
View raw message