Click to See Complete Forum and Search --> : Javascript alert() display Chinese charecters


qiuz
07-26-2006, 03:45 PM
I am trying to get Chinese characters to display in alert message box using Javascript. The Chinese charecters in html are displayed properly, but the Chinese charecters in javascripts dialog box appear as a little square box for each charecter. The ASCII charecters are displayed properly in alert message box.
###
unicode \u0031: 1
unicode \u6C34: a Chinese charecter "WATER"

###
<html>
<head>
<title>JavascriptTest</title>
<!--
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!--
<meta http-equiv="Content-Type" content="text/html; charset=GB2312">
-->
</head>
<body>
<script type="text/javascript">
alert("\u0031");
alert("\u6C34");
confirm("\u6C34");
</script>

&#x0031; <br/>
&#x6C34;

</body>
</html>

###
My html page is set to charset="utf-8"
My environment setting:
IE ver 6
IE encoding: utf-8
javascript: ver 1.3

Can anyone advise?

Qiu