Discussions

EJB design: HOW TO DISPLAY RUSSIAN CHARACTER IN JAVA SCRIPT ALERT BOX

  1. Мужской when i use this in my jsp page it show the correct russian character but when i use the same in javascript alertbox like this alert("Мужской"); its doesnt show the exact russian character instead it show the same "Мужской" can i get solution to show the characters in alert box. Thanks....
  2. Did you include UTF-8 in the JSP?
  3. Hi ramnath,
    Below is my code sample for the previous stated problem of displaying russian character in alert box.And u suggested the charset utf-8.So now can u check wat else to be included? with this code still iam getting the same html code in alert box.. any advice mr.ramnath.. please

    test.jsp
    ********

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <%
    String input = "&#1057;&#1090;&#1072;&#1085;&#1076;&#1072;&#1088;&#1090;";
    %>
    <%=input%>

    <html>
    <script type="text/javascript">
    function showChar(){
    alert("<%=input%>");
    }
    </script>
    <body onload="showChar()">
    </body>
    </html>
  4. Add following line to your JSP.

    <%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>

    & make sure this is the first line of your JSP.