I've attached a sample.aspx content, i've already doing a character
conversion from SHIFT-JIS to windows-1252, i've set responseconding to
'windows-1252' to post the data (rightclick on IE and encoding is western
european). but when i do that the , button which has japan text comes as
question mark... so what i need is that post with windows 1252 and have the
button display in same as displayed in the page.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
Inherits="_Default" ResponseEncoding="windows-1252"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"_
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="_
http://www.w3.org/1999/xhtml">
<script language="C#" runat="server">
public string in_simei_sei
{
get
{
string test = "陳";
Encoding nav = Encoding.GetEncoding(1252);;
Encoding unicode = Encoding.GetEncoding(932);
byte[] unicodeBytes = unicode.GetBytes(test);
return nav.GetString(unicodeBytes);
}
}
</script>
<script language="javascript" type="text/javascript">
function add(type, value) {
try {
var element = document.createElement("input");
element.setAttribute("type", type);
element.setAttribute("value", value);
element.setAttribute("name", type);
element.setAttribute("visible", false);
var foo = document.forms[0];
foo.appendChild(element)
}
catch (err) {
var txt = "There was an error on this page.\n\n";
txt += "Error description: " + err.description + "\n\n";
txt += "Click OK to continue.\n\n";
alert(txt)
return;
}
}
function postData()
{
try {
add("in_simei_sei", "<%=in_simei_sei%>");
}
catch(err)
{
var txt = "There was an error on this page.\n\n";
txt += "Error description: " + err.description + "\n\n";
txt += "Click OK to continue.\n\n";
return;
}
var xmlhttp = null;
if (window.XMLHttpRequest) {
// code for Firefox, Mozilla, IE7, etc.
try
{
xmlhttp = new XMLHttpRequest(); // instantiate it
}
catch (err)
{
alert("Error initializing XMLHttpRequest.\n" + err); // show
error
}
}
else if (window.ActiveXObject)
{
var msobj = new Array( "Msxml2.XMLHTTP.6.0",
"Msxml2.XMLHTTP.4.0",
"Msxml2.XMLHTTP.3.0",
"Msxml2.XMLHTTP",
"Microsoft.XMLHTTP");
var x, len = msobj.length;
for (x = 0; x < len; ++x)
{
try
{
xmlhttp = new ActiveXObject(msobj[x]);
break;
}
catch (err)
{
alert("Error initializing XMLHttpRequest : IE : \n" +
err.message); // show error
};
}
alert("inside else")
}
var processingUrl = "
http://www.google.com";
try
{
xmlhttp.open("POST", processingUrl,true); ; // open server
interface
}
catch (err)
{
var txt = "There was an error on this page.\n\n";
txt += "Error description: " + err.description + "\n\n";
txt += "Click OK to continue.\n\n";
// alert(txt);
return;
}
if (xmlhttp.readyState == 1)
{
try
{
xmlhttp.send(c_var);
}
catch (z)
{
alert(z)
}
}
//
}
</script>
</head>
<body>
<form id="Form1" runat="server" onsubmit="postData();" method="post"
action="
http://www.google.com">
<input type=submit runat="server">
<input type=button value="PC商å“一å¼" />
</form>
</body>
</html>