tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geo Lam" <>
Subject UTF-8 encoding problem (responding to browser)
Date Wed, 07 Aug 2002 04:19:29 GMT
Dear all,
  I have search the arhive list concerning the encoding problem of reading 
double byte character. I have used the tomcat filter to successfully reading 
chinese UTF-8 character and saving it into database(MS SQLServer2000 -MS 
JDBC driver).
  However, in the same servlet, I used the output writer to write the same 
string to the browser only with "???" characters. I have set 
response.setContentType("text/html;charset=UTF-8") but it doesn't work.
  What can I do to correct the output problem? Thanks.

Attached: a segment of code;
  // using tomcat filter to perform request.setCharacterEncoding("UTF-8")

  // output is ?? in browser but database is correct (display using 
System.out.print is also correct)

  System.out.println("response-encoding: " + response.getCharacterEncoding() 
  //output indicates that response is in UTF-8


Join the world’s largest e-mail service with MSN Hotmail.

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message