Kevin,
Is there any way you can convert the character encoding of your data in
your db to UTF-8 or UCS-2? That way all of the text in your page can be in
the same character set. You might also try to convert your data after
retrieving from the database using one of the String constructors that take
an encoding string as a parameter. The problem is that your browser can't
discern between the different encodings of the text in your web page.
-Richard
At 11:02 PM 10/14/01 +0700, you wrote:
>Hello
>
>First of all thanks for your answer. I tried what you suggested
>
>response.setContentType("text/plain; charset=window-874");
>
>The result was ... the characters queried from database were displyed
>currectly but all other
>characters in the web page were displayed as ???? instead. Do you have any
>further suggestion.
>Thanks in advance.
>
>Regards,
>Kevin
>
>
>----- Original Message -----
>From: "Richard Yee" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Sunday, October 14, 2001 1:34 PM
>Subject: Re: How to read unicode character from database and display on a
>web page?
>
>
> > You might try and set the charset of the res.setContentType() method.
> > Depending on the encoding of the characters in your DB, try using
> > response.setContentType("text/plain; charset=UTF-8");
> > or
> > response.setContentType("text/plain; charset=UCS-2");
> >
> > I think the default is ISO-8895-1 which is single byte.
> >
> >
> > regards,
> >
> > Richard
> >
> >
> > At 11:14 AM 10/14/01 +0700, you wrote:
> > >Hello.
> > >
> > >I'm having problem writing JSP to read character from database which is in
> > >Thai. If I use
> > >ResultSet.getString() the unicode character will be converted to byte and
> > >all Thai character will be
> > >displayed as ??????. Could anyone please tell me hoe to solve this
> problem?
> > >
> > >Thank you very much.
> > >Kevin
> > >
> > >
> > >PS. I tried something like this but didn't work :
> > >
> > > Reader char_stream = rs.getCharacterStream("subject");
> > > char[] ch = new char[1];
> > > while(char_stream.read(ch) != -1) {
> > > out.print(ch);
> > >}
> > >
> > >Would character in ch be in unicode ? If it is when i use
> > >JspWriter.print() it will be converted
> > >into byte anyway, right?
>
>
>
>_________________________________________________________
>Do You Yahoo!?
>Get your free @yahoo.com address at http://mail.yahoo.com
>
>
>___________________________________________________________________________
>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
___________________________________________________________________________
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