Re: UTF-8 Problem

Guy Katz <[email protected]>
Newsgroups gmane.comp.java.sun.servlet
Message-ID <[email protected]>
use an encoding filter to ensure encoding.
its the most common way of ensuring encoding as i know.
i remember all other ways had some bugs and were not consistent.

-----Original Message-----
From: K R Viju [mailto:[email protected]]
Sent: Monday, March 29, 2004 2:38 PM
To: [email protected]
Subject: Re: UTF-8 Problem


Erik,
we cannot set encoding of request in the servlet,... do we?
I guess we have no method like setCharacterEncoding()

Viju
----- Original Message -----
From: "Erik Beijnoff" <[email protected]>
To: <[email protected]>
Sent: Monday, March 29, 2004 5:36 PM
Subject: Re: UTF-8 Problem


> >Hi All,
> >I have a HTML page in which user can enter data in
> >different languages, like ARABIC, ENGLISH etc. Hence i
> >have made the page as charset=utf-8. Now when i submit my
> >page to a servlet, all the characters except ascii are going
> >as "?". This happens only when i use IE6 with ServicePack1
> >run. But it works fine with IE6 without SP1. I am using Tomcat
> >3.3.2. What could be wrong? Does anybody finds any hint?
>
> Try adding this snippet to the start of your doGet() method. It may be
> because the servlet does not recognize the request as being encoded in
> UTF-8.
>
> if(req.getCharacterEncoding() == null){
>         req.setCharacterEncoding("UTF-8");
> }
>
> Regards Erik Beijnoff
>
>
___________________________________________________________________________
> 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

___________________________________________________________________________
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.