Hi Jiju ,

Following method is a part of my JSP Utility class.
Set the encoding of source and target string  into parameter
of constructor of Stirng class.

=Mikako


        static public String convertString  ( String rStr )
        {
                String ret = null ;
                try {
                        if ( rStr != null )
                        {
                                ret = new String ( 
rStr.getBytes("iso-8859-1"),"Shift_JIS") ;
                        }               // ~ here
                        else
                        {
                                ret = rStr ;
                        }
                }
                catch ( UnsupportedEncodingException e )
                {
                        e.printStackTrace();
                }

                return ret ;
        }



On Thu, 24 Oct 2002 14:07:14 +0530
JOSHY MON M C <[EMAIL PROTECTED]> wrote:

> Dear All,
>
>  I have created an HTML form. with some input text fields. I am using POST
> method for submitting the request to a servlet. My servlet is running in
> Tomcat 4.1. My html page contains japanese charectors and thus I use
> Shift_JIS as the encoding for my html page. Servlet application reads the
> data using getParameter() and processing it. In the normal senario, it works
> well.
>
> But when I enter JAPANESE characters in these text fields and request to
> Servlet for data processing, Servlet's getParamer() is returning junk
> charecters(??). I think this problem is because Tomcat by default encodes
> all the paramets in ISO8859_1 encoding. But as my html encoding is Shift_JIS
> browser will encode the form parameters using Shift_JIS and Tomcat cannot
> recognize this. Is my assumption correct? Do you know any technique to
> resolve this issue.?
>
> TIA
> Jiju George
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://archives.java.sun.com/jsp-interest.html
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.jsp
>  http://www.jguru.com/faq/index.jsp
>  http://www.jspinsider.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to