WinHttpRequest throws "No mapping for the Unicode character exists in the target multi-byte code page".
KOLANICH opened this issue · 0 comments
KOLANICH commented
Recently M$ changed something in their website, which made WinHttpRequest crash with error "No mapping for the Unicode character exists in the target multi-byte code page".
doesn't work.
whr = new ActiveXObject("WinHttp.WinHttpRequest.5.1");
...
var oADO=new ActiveXObject("ADODB.Stream");
oADO.Type=1;
oADO.Mode=3;
oADO.Open();
oADO.Write(whr.ResponseBody);
oADO.Position=0;
oADO.Type=2;
oADO.Charset="x-ansi";
//oADO.Charset="utf-8";
res=oADO.ReadText();
oADO.Close();
doesn't work - it either throws error or puts in res few bytes from whole response body.
Another try
var isSuccessful=false;
whr.WaitForResponse(-1,isSuccessful);
res=whr.ResponseStream.Read();
throws an error that ResponseStream is either null or undefined.
I don't know how to use ResponseBody as an array, both tries to use it either as js array or as WSH collection have failed.