tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcin Jaskuła <jask...@expro.pl>
Subject Problem with page encoding for ISO-8859-2
Date Mon, 20 Aug 2001 18:39:24 GMT
Hi,

I have change my JSP server form JServ to Tomcat (v. 3.2.3-1) recently and
found several problems with page encoding.
I have looked into the archive and found a lot of mails about the problem
but no simple solutions.

The problems are:

1. Compilation problem:
I wrote some simple jsp page, which consists of some polish character:

<%@ page contentType="text/html; charset=iso-8859-2" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-2">
</head>
<body>
ą
</body>
</html>

The server crashes with error 500:

Internal Servlet Error:

org.apache.jasper.JasperException: Unable to compile class for JSP
Found 1 semantic error compiling "_0002fa_0002ejspa_jsp_0.java":

    56.                 out.write("\n\n\n\n\n\n\n\u00-$\u00)%
<----------\n\n\n");

*** Error: The value of this "String" literal is invalid. Perhaps it
contains a bad escape sequence?

If I change "ą" to "a" it works !
In my opinion the characters are translated to the Unicode in wrong way.

2. I cannot get proper values from the forms. When I use
request.getParameter() method I get different characters then I write into
form's fields (returned characters depend on the "page contentType" value
but always are wrong).

3. When I try to print some data from a database I get wrong characters in
the output !


The best solution is to turn off all encoding of IO streams and before
compilation of the jsp page. Maybe somebody has done it already or there is
some other method to solve the problems.

Bye
	Marcin



Mime
View raw message