How to get Cyrillic responsetext
-
26-04-2021 - |
Question
Dim http As WinHttpRequest
Set http = New WinHttpRequest
http.open "POST", "test.php", False
http.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
http.send "txtmbx=test"
msgbox(http.responsetext)
http.responsetext
is in Cyrillic and I'm unable to read text. How can I retrieve Cyrillic?
Solution
The WinHTTPRequest does not support an encoding method, and while it doesn't explicitly say, I expect it uses CP_ACP
, the system default codepage when converting from the received byte data to a string.
You can use the ResponseBody
method to get the data as a byte array and use StrConv
to convert to a string as you wish.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow