Yes! I try it out! Just share my experience with you(although it seems silly).
I can get my query string in Big5 as following function:

private String decodeBig5(String str) {
  String rstr;
  try {
    rstr = new String(URLDecoder.decode(str).getBytes(),"Big5");
  } catch (Exception e) {
    rstr = str;
  }
  return rstr;
}

<%=decodeBig5(request.getParameter(name)) %>

Arun Thomas �g�D�G

> Hi!
>
> I think you may not need to use any of the io classes to convert the
> encoding of the query]
> string.  (I assume you are using the JDK 1.2.2 here, and my comments will be
> based on that
> assumption.)
>
> When you obtain the querystring from the request, it is probably transformed
> from bytes and
> encoded using a particular character encoding (probably the default of the
> platform).  As a result,
> you should be able to use one of the getBytes methods of the String class in
> order to obtain
> a byte array.  With this Byte array, you can create a new String with a
> specified encoding (see
> the JavaDocs for String constructors.)
>
> This process should get you a Big5 version of the queryString.
>
> -AMT
>

--
  Ming-Cheng Chen (������)
  Associate Researcher
  ChungHwa Telecom Co., Telecommunication Lab.
  Electronic Toll Collection for Highway Project
  Tel: 886-3-4245996     Fax: 886-3-4245194
  E-mail: [EMAIL PROTECTED]
  http://www.ham.com.tw/~bm4acd

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

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to