1
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?

Costique
  • 23,712
  • 4
  • 76
  • 79
No Name
  • 719
  • 6
  • 14

1 Answers1

0

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.

Deanna
  • 23,876
  • 7
  • 71
  • 156
  • Thank for your response it lead me to the right direction. If i put my string in byte array and use responsebody and strConv, when i display message box still message is unreadable, but if i save in a text file for example test.html with , and run html, characters are just fine I use ADO Stream object to convert utf8 bytes to string. Thanks Again – No Name Feb 10 '12 at 01:46
  • Using ADO for this is extremely overkill. You should really use [MultiByteToWidechar()](http://www.vbforums.com/showthread.php?t=33525) – Deanna Feb 10 '12 at 11:54