Q1:
perhaps convert byte to unicode string
Q2:
Unicode to Gb2312
ServletOutputStream outs = res.getOutputStream();
// apend
PrintStream out = new PrintStream( outs ) ;
res.setContentType("text/html");
out.println ("<HTML><HEAD>");
out.println ("<TITLE>Test servlet html page</TITLE>");
...
out.println (here is some Chinese character codes);
...
out.println ("</BODY></HTML>");
out.close();
-----Original Message-----
������: SUBSCRIBE SERVLET-INTEREST jack-wang <[EMAIL PROTECTED]>
�ռ���: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
����: 1999��5��17�� 9:16
>Question 1:
> I save some Chinese character code in database, and grab the code(foreign
characters) from the database, the result is that most part of the Chinese
code is OK, but all the codes behind the codes: "\u5200" and "\u4e00" are
lost.
> The servlet server is JRUN, and the OS is win95, and some of my code is:
>"
> ByteArrayOutputStream bytes;
> PrintStream out;
> bytes = new ByteArrayOutputStream (4096);
> out = new PrintStream (bytes);
> out.println ("<HTML><HEAD>");
> ...
> // fetch Chinese codes from database , and output to out.
> out.flush ();
> res.setContentType("text/html");
> res.setContentLength (bytes.size ());
> bytes.writeTo (res.getOutputStream ());
>"
>
>Question 2:
> I can not output Chinese character code to html. the code is:
>"
> ServletOutputStream out = res.getOutputStream();
> res.setContentType("text/html");
> out.println ("<HTML><HEAD>");
> out.println ("<TITLE>Test servlet html page</TITLE>");
> ...
> out.println (here is some Chinese character codes);
> ...
> out.println ("</BODY></HTML>");
> out.close();
>"
>I will be glad to hear from you, and any help would be greatly appreciated.
>
>
>__________________________________________________
>��ӭʹ����������ѵ�������http://freemail.263.net
>
>___________________________________________________________________________
>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