Skip to content
This repository has been archived by the owner on Oct 2, 2023. It is now read-only.

WinHttpRequest throws "No mapping for the Unicode character exists in the target multi-byte code page". #1

Open
KOLANICH opened this issue Dec 19, 2015 · 0 comments

Comments

@KOLANICH
Copy link
Member

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant