I am trying to use the WinHTTP library with Basic Authentication. I'm testing the case where the user name or password has "special" characters (ie, not in Windows-1252) and I cannot seem to set the credentials using WinHttpSetCredentials
The outcome is an error, with code 87 ("The parameter is incorrect")
'extended ascii' (128~255) in the sense of Windows-1252 will work.
I've sniffed the headers, and it seems like WinHTTP re-encodes my user/pass in Windows-1252.
My call looks like this, and it returns false when user or pass have non-Win1252 characters.
::WinHttpSetCredentials(requestHdl, dwTarget, m_authScheme /*basic*/,
user.c_str() /*wstring in UCS2*/,
pass.c_str(), /*wstring in UCS2*/
NULL /*reserved?*/)
Any suggestions as to why this call doesn't support general wstring characters properly? I can't find anything in the documentation (except for a strange flag about assuming the data is ASCII...).