Unable to print 'Chinese' through JavaScript.....please help


Web tier: servlets, JSP, Web frameworks: Unable to print 'Chinese' through JavaScript.....please help

  1. Hi experts,

    I am unable to display 'chinese' characters through Javascript. For example the following statement is giving unicode characters, rather than chinese.

    alert("<%= bundle.getString("welcome")%>");

    The following statement giving Chinsese output as expected.

    <%= bundle.getString("welcome") %>

    Inorder to output 'Chinese' through JavaScript, what have to i do ??
    Please let me know if there is any document on this...


  2. In my opinion,you should convert chinese characters to GBK,then print it.
  3. That's because your browser doesn't have the chinese language set installed, OR because the web server is returning the language as en/US which is now what you want. Set the return language in the JSP and you should be OK once you install the right character set in the browser.


  4. Hi,
    you are not right.
    I am able to print chinese from JSP, but faild to display chinese from javascript from the same JSP.

  5. chinese charecter in alert messages[ Go to top ]

    Hello Srinivas I am facing a similar probems where chinese charecters appear very well in the JSP page but the decimal equivalent (&#nnnn) appear in javascript alert. Please share your learning if you could resolve the problem. Regards