You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by "Clere, Jean-Frederic" <jf...@fujitsu.siemens.es> on 2000/05/10 14:58:15 UTC
Porting to EBCDIC
Hi,
I have got Tomcat running OK on an EBCDIC machine.
Some changes are needed in ./src/share/org/apache/jasper/compiler:
Compiler.java (OutputStreamWriter+argv)
JspReader.java (InputStreamReader)
SunJavaCompiler.java (-encoding, encoding)
The idea is to use InputStreamReader(InputStream) that Create an
InputStreamReader that uses the default character encoding.
and OutputStreamWriter(OutputStream) that Create an OutputStreamWriter that
uses the default character encoding.
That way the jsp and java files are in the default character encoding.
I DO think that the jsp and java files should be editable with the default
editor.
The java source files are already in EBCDIC, and it is better that the jsp
files are also in EBCDIC.
This should be the default handling.
The changeEncodingIfNecessary method reads "contentType" and "charset=" to
find the encoding of the jsp file, but according to the JSP Developer's
Guide it is information about the response to send to the client... And it
works only with ASCII.
I propose to use a other method to find the encoding of the jsp:
1 - Try default character encoding. Search for <html>. If found return null.
2 - Do something similar to the xml handling searching of <html> and return
the found encoding.
3 - Return null otherwise.
Then if null use the default character encoding otherwise use the found
encoding.
Please note that it should have little impact on the performances because we
already do conversions and the jsp file are not changed so often
Cheers
Jean-Frédéric Clère
EP LP COM 5 (BCN)
Fujitsu Siemens Computers
Phone + 34 93 480 4209
Fax + 34 93 480 4201
Mail mailto:jfrederic.clere@fujitsu.siemens.es