Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4637684

Can't show correct Big-5 character in Servlet

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 1.4.0
    • core-libs

      Name: gm110360 Date: 02/13/2002


      FULL PRODUCT VERSION :
      java version "1.4.0-beta3"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta3-b84)
      Java HotSpot(TM) client VM (build 1.4.0-beta3-b84, mixed mode)

      FULL OPERATING SYSTEM VERSION :
      Linux Mandrake 8.1
      install as Chinese Traditional environment

      ADDITIONAL OPERATING SYSTEMS :
      Jakarta Tomcat 4.0.1


      A DESCRIPTION OF THE PROBLEM :
      I wrote a simple servlet to show the text:
      "Hello!! TServlet!!嗨!! 中文!!"
      The first half is English, and the second half is
      Tradition Chinese in Big5 code.

      In jdk1.3.1, it works correctly, but in jdk1.4.0,
      the Chinese characters change to '?'

      Please check and fix it.




      REGRESSION. Last worked in version 1.3.1

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1.Setup Mandrake Linux 8.1, JDK1.4.0, Jakarta Tomcat 4.0.1
        By drfault configuration.
      2.Run the servlet attached on this report
      3.The display of Big5 characters become '?'

      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javax.servlet.*;
      import javax.servlet.http.*;
      import java.io.*;

      public class TServlet extends HttpServlet {
         
          public void init(ServletConfig config) throws ServletException {
              super.init(config);

          }

          public void destroy() {

          }

          protected void processRequest(HttpServletRequest request, HttpServletResponse response)
          throws ServletException, java.io.IOException {
              response.setContentType("text/html;charset=Big5");
              java.io.PrintWriter out = new PrintWriter(response.getOutputStream());
              out.println("<html>");
              out.println("<head>");
              out.println("<title>Servlet</title>");
              out.println("</head>");
              out.println("<body>");
              out.println("Hello!! TServlet!!");
              out.println("&#21992;!! &#20013;&#25991;!!");
              out.println("</body>");
              out.println("</html>");
                      
              out.close();
          }

          protected void doGet(HttpServletRequest request, HttpServletResponse response)
          throws ServletException, java.io.IOException {
              processRequest(request, response);
          }

          protected void doPost(HttpServletRequest request, HttpServletResponse response)
          throws ServletException, java.io.IOException {
              processRequest(request, response);
          }

          public String getServletInfo() {
              return "Short description";
          }

      }

      ---------- END SOURCE ----------
      (Review ID: 138131)
      ======================================================================

            ilittlesunw Ian Little (Inactive)
            gmanwanisunw Girish Manwani (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: