cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From MORÁVEK Peter <>
Subject Encoding problems
Date Tue, 14 Mar 2000 09:52:39 GMT
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


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));, 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 set the encoding for the 
input stream.

Any suggestions ?


Peter Moravek

View raw message