Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Tomcat Users »

German Umlauts in Tomcat5

Christian Traber

2004-05-14

Replies:

Hi,

following example works with tomcat 4.1.30 but makes problems with tomcat 5.0.19 on SuSE9.1:


Client side:

 // vir.shortName = Gf�llner
 String username = URLEncoder.encode(vir.shortName,"UTF-8");  
  // ==> username = Gf%C3%BCllner

    HttpURLConnection huc = (HttpURLConnection) url.openConnection();

    huc.setUseCaches (false);
    huc.setDefaultUseCaches(false);
    huc.setRequestMethod("GET");
 huc.setRequestProperty("Content-Type", "text/plain;charset=utf-8");
 ...

Serlet side:

 // request.getCharacterEncoding() => utf-8
 String username = request.getParameter("username");
 // username = Gf??llner

same problem with:
 String username = new String(username.getBytes(),"UTF-8");  
 // username = Gf??llner


Any Ideas?


Best Regards
Christian


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.