----- Original Message -----
From: "sudhir" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>

> encoding in response header .i think it should work.
> even if does not work send ur code so that we can
> understand it in better way.
>
> so replace ur response.setContentType("text/html;
> charset=UTF-8");

This is not supported by the servlet API. The setting of the charset used
for the response *is not required* affect the charset used by the container
for the request parameters, although some containers do behave in this way.
As far as servlet API version 2.2 is concerned there is no way to achieve
this across containers other than to convery the paramter to the charset you
are expecting it to be in by doing the following.

String param = request.getParameter("name");
param = new String( param.getBytes("ISO-8859-1"), "UTF8");

If you are coding for the API version 2.3, you can look at the method
ServletRequest.setCharacterEncoding().

Regds,
Gokul


>
> regards
> Sudhir Garg
>
>
>
> amin wrote
> Dear All,
>  I'm building a mutilaguage website in which i use
> UTF-8 as the charset for my
>  servlet but the getParameter() method uses ISO-8859-1
> as its default encoding
>  which results in the unicode characters not found in
> ISO-8859-1 are mapped
>  incorrectly to different characters. Such as the
> special german characters for
>  each mapped to two incorrect characters. So, how can
> i enforce the
>  getParameter() to use UTF-8 to generate valid unicode
> characters ?
>
> Any help will be appreciated.
>
> Regards,
>  M. Amin
>
>
> __________________________________________________
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail - only $35
> a year!  http://personal.mail.yahoo.com/
>
>
___________________________________________________________________________
> 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

___________________________________________________________________________
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