thanks Craig,
Craig wrote :
>
> It sounds like you might be working too hard :-).
how did you understand? :)
>
> Internally, Java keeps all String values in Unicode. When you actually
> write the response, it will be converted according to the character
> encoding you specify on the page.
theoretically you are right, but unfortunately in real applications , it
seems it is not like that.
>
> If you're using JSP you would put this at the top of your page:
>
> <%@ page contentType="text/html;charset=Big5" %>
>
it is already at the top of my every single jsp page.
> and then write out the values something like this:
>
> <%= sb.getItemname(itemid) %>
i already have this too in my code,too.
>
> From a servlet, the important issue is to set the content type and
> character encoding *before* you get the PrintWriter:
>
> response.setContentType("text/html;charset=Big5");
> PrintWriter writer = response.getWriter();
> ...
> writer.print(sb.getItemname(itemid));
>
> In either case, Java will perform the Unicode->Big5 conversion for you.
then why am i keeping on getting garbled symbols instead of traditional
chinese chars?
by the way, other than the strings retreived from the bean, other big5 chars
are displyed correctly.
it seems that the problem occurs when the data is stored in the hahtable or
when it is retreived.
thanks again for your help.
best regards :)
>
> Craig McClanahan
>
>
>
> --
> To unsubscribe: <mailto:[EMAIL PROTECTED]>
> For additional commands: <mailto:[EMAIL PROTECTED]>
> Troubles with the list: <mailto:[EMAIL PROTECTED]>
>
>
--
To unsubscribe: <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>