Hello Bill:

  I'm using this method in a servlet.
  It is able to handle both latin and Japanese character correctly.

    String getParameter(HttpServletRequest req, String key)
        throws IOException
    {
        String value = req.getParameter(key);
        if (value != null) {
            value = new String(value.getBytes("8859_1"), "JISAutoDetect");
        }
        return value;
    }

        Ryo Iwasaki, NTT
        [EMAIL PROTECTED]

Bill wrote:

> How do I correctly handle the parsing of the query string and form input
> such that req.getParameter will return the contents appropriately converted
> from a native character encoding such as Shift_JIS to Unicode?
>
> Unless I'm missing something, it appears the 2.x Servlet API doesn't provide
> a way to indicate what character encoding should be used when parsing the
> query string and form input.
>
> If this is the case, it looks like I'll have to implement a version of
> javax.servlet.http.HttpServletRequest that correctly converts query string
> and form input from a specified character encoding so my version of
> req.getParameter will work correctly.
>
> For now, I only need to support IE 4.0 and Netscape 4.0 browsers.
>
> Thanks for any assistance,
> -Bill
> --
> [EMAIL PROTECTED]

___________________________________________________________________________
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