W
wtistang
I need some suggestions regarding a problem I am facing. I have a web
page (asp.net and C#) which containing Chinese characters. In my
web.config file I have:
<globalization
requestEncoding="iso-8859-1"
responseEncoding="iso-8859-1"
fileEncoding="iso-8859-1"
/>
and I also put
Response.Charset="chinese";
in the page_load event.
I hard-coded some of the Chinese characters in my aspx page and save it
using "save with encoding". The hard-coded Chinese strings look OK
when the page is loaded. My problem is when I try update some of them
with the data I got from an XML file, they become "?????????" after
the update. Here is the sample code I have:
XmlDocument doc = new XmlDocument();
doc.Load(Server.MapPath("abf_c.xml"));
XmlNode myNode = doc.DocumentElement.SelectSingleNode("//Pro[@Model='"
+ lblModel.Text + "']");
string spects=myNode.InnerText.ToString();
lblSpects.Text= spects;
In debug mode I can see that spcts has the right Chinese character, but
when the page is loaded label control lblSpects conatians "????????".
Any idea how to get around it?
Thanks in advance.
MT
page (asp.net and C#) which containing Chinese characters. In my
web.config file I have:
<globalization
requestEncoding="iso-8859-1"
responseEncoding="iso-8859-1"
fileEncoding="iso-8859-1"
/>
and I also put
Response.Charset="chinese";
in the page_load event.
I hard-coded some of the Chinese characters in my aspx page and save it
using "save with encoding". The hard-coded Chinese strings look OK
when the page is loaded. My problem is when I try update some of them
with the data I got from an XML file, they become "?????????" after
the update. Here is the sample code I have:
XmlDocument doc = new XmlDocument();
doc.Load(Server.MapPath("abf_c.xml"));
XmlNode myNode = doc.DocumentElement.SelectSingleNode("//Pro[@Model='"
+ lblModel.Text + "']");
string spects=myNode.InnerText.ToString();
lblSpects.Text= spects;
In debug mode I can see that spcts has the right Chinese character, but
when the page is loaded label control lblSpects conatians "????????".
Any idea how to get around it?
Thanks in advance.
MT