Hi all,

Per URI's specification (RFC 2396), the character set of URI is US-ASCII.  There
are ways to encode non-ASCII characters in URI outside the scope of the RFC.  In
fact, the general way to send non-ASCII input in HTTP in HTTP request body so
that the character set information can be tagged with "Content-Type" header in
the request.  That boils down to the use of POST method instead of GET method if
you are actually using HTML form input.  I hope that the browsers are setting
the "Content-Type" header with character set actually and the Web servers and
Servlet/JSP runners are decoding the characters correctly.

I haven't done an extensive research on it.  This is just what I find out from
the spec briefly.

Thanks.

Rob

----- Original Message -----
From: "Arun Thomas" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 23, 2000 7:49 AM
Subject: Re: Convert query string into Chinese.


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

> -----Original Message-----
> From: A mailing list about Java Server Pages specification and
> reference [mailto:[EMAIL PROTECTED]]On Behalf Of Yoyo Chen
> Sent: Wednesday, March 22, 2000 9:44 PM
> To: [EMAIL PROTECTED]
> Subject: Convert query string into Chinese.
>
>
> Hi, all:
>
> I use String rstr = new BufferedReader(new InputStreamReader(new
> StringBufferInputStream(str), "Big5")).readLine(); to convert query
> string into Chinese(Big5). But StringBufferInputStream was
> deprecated. How can I do this? Can anyone give me a hint?
> --
>   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
>

===========================================================================
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

===========================================================================
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