Hi!

I have had similar problem with Cp1250 encoding(Tomcat and MySQL). You 
have to have in mind this was not done on Tomcat 4.x, but 3.x.
This is what I have done:
- <%@page contentType="text/html; charset=windows-1250"%> on top of 
every JSP file
- default_character_set=latin2 in my.cnf
- created new database so it gets created in latin2 character set
- when I connected to MySQL I was using mm.mysql driver and the database 
URL was 
jdbc:mysql://hostname:port/database?characterEncoding=Cp1250&useUnicode=true

Then all characters were correctly displayed on JSP pages.

I hope this helps.

Best regards,
        Kovi

Nikola Milutinovic wrote:

> Hi all.
> 
> It's me again and troubles are not resolved. I've created a simple test servlet:
> 
> ----------------------------------------
> import javax.servlet.*;
> import java.io.*;
> 
> public class TestServlet extends GenericServlet {
>   private static final String testText = "\uC5A0 \uC5A1 \uC486 \uC487 \uC48C \uC48D 
>\uC490 \uC491 \uC5BD \uC5BE";
>   PrintWriter out;
> 
>   public void service( ServletRequest req, ServletResponse res )
>     throws javax.servlet.ServletException, java.io.IOException
>     {
>     res.setContentType("text/html; charset=ISO-8859-2");
>     out = res.getWriter();
>     out.print( "<html>\r\n<head><title>Test servlet</title>\r\n" );
>     out.print( "<meta http-equiv=\"Content-Type\" content=\"text/html; 
>charset=iso-8859-2\">\r\n</head>\r\n" );
>     out.print( "<body>\r\n<h1>Test</h1>\r\n<p>Let us see how this gets 
>out</p>\r\n<p>\r\n<p>" );
>     out.print( testText );
>     out.print( "</p>\r\n</body>\r\n</html>" );
>   }
> }
> ----------------------------------------
> 
> This prints "?" instead of characters. The string in question prints desired 
>characters in an ordinary Java application.
> 
> QUESTION 1
> ---------------
> How can I get Tomcat to honour "charset=ISO-8859-2"?
> 
> QUESTION 2
> ---------------
> What about static HTML? Suppose I should enter a part of static HTML data in Latin-2 
>encoding. That translates to a string. A string is supposed to be Unicode. Do those 
>strings get translated from "pageEncoding" to Unicode?
> 
> Nix.
> 



--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to