tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geo Lam" <geo...@hotmail.com>
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")
  System.out.println(request.getParameter("edTextBox"));

  // 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

Thanks



_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message