0

I'm using the following script to get the content of a URL:

WinHTTP = WScript.CreateObject('WinHttp.WinHttpRequest.5.1') ;
WinHTTP.Open( 'GET', theUrl ) ;
WinHTTP.Send() ;
var content = WinHTTP.ResponseText ;

which works fine except when the content of the URL is XML with UTF-8 encoding and there are latin1 characters in it.
I get an error about something missing in the multibyte codepage, and the script is terminated.

How can I tell WinHttp to ignore that error?

PS: The error occurs in Windows Vista but not in Windows XP (I don't know about Win 7 or 8).

GetFree
  • 40,278
  • 18
  • 77
  • 104
  • That would escape special characters like "/", ".", ":", etc. Either way, te problem is not the URL but the content (the body of the response) which is an utf8-encoded XML webpage with some characters in latin1 encoding and that triggers a run-time error in Win Vista (but not in XP, weird). – GetFree Feb 20 '13 at 17:52

1 Answers1

0

I think that my answer here (on a variant of this question) s'd answer this as well.

Community
  • 1
  • 1
Panayot Karabakalov
  • 3,109
  • 3
  • 19
  • 28