I had a similar problem and use ByteArrayInputStream. So I had to convert my string
to byte[]... This works even if it's not very clean.
    But I had an other problem : I used this in a DecodeURL servlet to intercepte
the URL of an applet (not mine si I havn't the source) which seems to encode it
with UTF-8, so the destination files did'nt recognize the parameters (those with
accent).
So the applet is linked to DecodeURL which decode the parameters and forward to a
JSp files. This worked with Netscape ! I saw after that IE 5 doesn't encode the
parameters !! How can I know if the browser has encoded the parameters with UTF-8
or not. Does this depend on the browser or an option in the browser ?

Thanks
Veronique

Jason Hunter a écrit :

> Yoyo Chen wrote:
> >
> > 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?
>
> I don't think you can, because this is a behavior the JDK doesn't
> expect -- treating a String like an array of bytes.  If anyone has a
> way, speak up.  I'll change p. 393 of my book to match.  :-)
>
> The good news is the method is only deprecated, not removed, so the
> code still works and probably will for a long time.  I'll scream loudly
> if they ever remove it.
>
> -jh-
>
> --
> Jason Hunter
> [EMAIL PROTECTED]
> Book:    http://www.servlets.com/book
> 2.0 to 2.1: http://www.javaworld.com/jw-12-1998/jw-12-servletapi.html
> 2.1 to 2.2: http://www.javaworld.com/jw-10-1999/jw-10-servletapi.html
>
> ===========================================================================
> 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