head8k
02-21-2003, 04:23 PM
I am having problems fetching some XML from a remote server using XMLHTTP. The code below works fine and will grab the source code from google and make a local copy, the problem lies when I put in the real URL I want to grab: http://diveintomark.org/xml/fosnews.php.
I know that the problems are being caused by non-ASCII characters in the response text but how can I get around this?
<html>
<head>
<title>XMLHTTP Example</title>
</head>
<body>
<%
dim http, fso, localfile
set http = Server.CreateObject("Microsoft.XMLHTTP")
http.Open "GET", "http://www.google.com", false
http.SetRequestHeader "Content-type", "text/html"
http.Send
set fso = Server.CreateObject("Scripting.FileSystemObject")
set localfile = fso.CreateTextFile(Server.MapPath("journals.xml"), True)
localfile.writeLine http.responseText
set fso = nothing
set http = nothing
%>
</body>
</html>
I know that the problems are being caused by non-ASCII characters in the response text but how can I get around this?
<html>
<head>
<title>XMLHTTP Example</title>
</head>
<body>
<%
dim http, fso, localfile
set http = Server.CreateObject("Microsoft.XMLHTTP")
http.Open "GET", "http://www.google.com", false
http.SetRequestHeader "Content-type", "text/html"
http.Send
set fso = Server.CreateObject("Scripting.FileSystemObject")
set localfile = fso.CreateTextFile(Server.MapPath("journals.xml"), True)
localfile.writeLine http.responseText
set fso = nothing
set http = nothing
%>
</body>
</html>