Hi,

I think that  response.setContentType("text/html;charset=UTF-8;"); is the
good solution.

if you use this,
String param = request.getParameter("name");
param = new String( param.getBytes("ISO-8859-1"), "UTF8");
it will translate the string back to 1 char to 1 character from response,
because Java Strings use char and char in java has 2 bytes by default.

If you use the first example, browser will send data to the server
translated to utf-8 (like this : text=%C4%9B), and than it will be
translated OK to UTF-8 with request.getParameter("name");
and String returned by getParameter will have length of 2 for 1 special
character

hope this help
Tomas Zeman

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to