PDA

View Full Version : ShowModalDialog and Unable to display Unicode


brian2781
05-02-2005, 11:11 AM
I have an asp application. The application now is adding support for unicode. My problem is as I place a Unicode value at the end of the URL for showmodaldialog method's first argument (which specifies the URL of the document to load and display), I found that the Unicode value is unabled to display. The page only shows "?" instead of the Unicode value. I am using IE6.0 sp2. Can the showmodaldialog method send the Unicode character?
I have already added <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
in order to support Unicode. Please help.

A.html
---------
<html>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<Title >A HTML Page To call ASP page</Title>
</head>

<SCRIPT>
function fnRandom(iModifier){
return parseInt(Math.random()*iModifier);
}

...
...

function fnOpen(){
var sFeatures=fnSetValues();
var strTemp = "b.asp?abc=123";
window.showModalDialog("b.asp?abc=123试用" , "", sFeatures)
}
</SCRIPT>


<FORM NAME=oForm>
<p>Height Property: <SELECT NAME="oHeight">
<OPTION>-- Random --
<OPTION>450
<OPTION>500
<OPTION>550
<OPTION>600
</SELECT></p>

Create Modal Dialog Box
<INPUT TYPE="button" VALUE="Please Click"
onclick="fnOpen()">
</FORM>
</html>




B.ASP
---------

<% Option Explicit %>
<% Response.Expires = -1 %>

<html>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<title>happy</title>
</head>

<body bgcolor="#FFFFFF" text="#000000">
<h1><font color = 'blue'>Hello B ASP Page</font></h1>
<h1>: <%Response.write request.QueryString("abc")%> :</h1>
</body>
</html>


Result:
--------
Expected: "123试用"
but the page show :"123??"

glenngv
05-03-2005, 03:53 AM
Try escaping it.

var strTemp = "b.asp?abc=123" + escape("试用");
window.showModalDialog(strTemp , "", sFeatures);