I'm using MSIE5.5 and MSXML v3.
Basically, if I do a File->Open from the browser,
and open the XML file, I can see the Chinese characters.
However, if I loads the XML document through a ASP script,
the Chinese characters are all replaced by question marks.
Any idea what's the problem here?
Following is my code in ASP:
===
Response.Write("<?xml version=\"1.0\" encoding=\"UTF-8\"?><html><title>loadXML</title><meta content=text/html; charset=UTF-8 />"
var dom = Server.CreateObject("MSXML2.DomDocument"
dom.async = 0;
dom.load(Server.MapPath("testexport.xml");
var parseError = dom.parseError;
if (parseError.errorCode != 0) {
var e = new Error("Error: line " + parseError.line + "; reason = " + parseError.reason);
throw(e);
}
var root = dom.documentElement;
var e, child;
e = new Enumerator(root.childNodes);
for (;!e.atEnd();e.moveNext())
{
child = e.item();
Response.Write(child.text + "<br>"
}
=====
Basically, if I do a File->Open from the browser,
and open the XML file, I can see the Chinese characters.
However, if I loads the XML document through a ASP script,
the Chinese characters are all replaced by question marks.
Any idea what's the problem here?
Following is my code in ASP:
===
Response.Write("<?xml version=\"1.0\" encoding=\"UTF-8\"?><html><title>loadXML</title><meta content=text/html; charset=UTF-8 />"
var dom = Server.CreateObject("MSXML2.DomDocument"
dom.async = 0;
dom.load(Server.MapPath("testexport.xml");
var parseError = dom.parseError;
if (parseError.errorCode != 0) {
var e = new Error("Error: line " + parseError.line + "; reason = " + parseError.reason);
throw(e);
}
var root = dom.documentElement;
var e, child;
e = new Enumerator(root.childNodes);
for (;!e.atEnd();e.moveNext())
{
child = e.item();
Response.Write(child.text + "<br>"
}
=====