- Is the data in the db stored as ISO-8859-2 ? (looks like it is stored is
8859-1)
- Use UTF-8 to store the data, this way you can use UTF-8 as well as the ISO
content type that corresponds with the data.

If you gonna use utf 8 and run into a lot of MalformedInputExceptions you
can be sure that the data is stored as 8859-1..

Mvgr,
Martin

> -----Original Message-----
> From: Marcin Jaskuła [mailto:[EMAIL PROTECTED]]
> Sent: Monday, August 20, 2001 8:39 PM
> To: Tomcat-User
> Subject: Problem with page encoding for ISO-8859-2
>
>
> 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
>
>
>

Reply via email to