1

I am using MSXML2.XMLHTTP60 to send text messages via VBA using a web server. I cannot understand why the € symbol is not displayed when receiving a text message. Other special characters, such as ò,à,è etc are displayed after a conversion function I wrote (for example à is encoded as "%E0"). I suppose that web server is expecting charset iso 8859-1 which doe not support € symbol. Therefore how can I solve this problem?

Zev Spitz
  • 13,950
  • 6
  • 64
  • 136
ubaldo
  • 41
  • 5

2 Answers2

1

If your request is a POST request then you can specify header for Content-Type with encoding e.g. like this:

objHTTP.Open "POST", ...
objHTTP.setRequestHeader "Content-Type", "text/html; charset=utf-8"

But for GET request the URL with possible query string parameters will be encoded as ASCII. Read e.g. this post.

Community
  • 1
  • 1
Daniel Dušek
  • 13,683
  • 5
  • 36
  • 51
  • Hi dee, you are absolutely right! I changed "GET" to "POST" and added the string you suggested and it worked! :) I was struggling since days to solve this issue and eventually I managed to iron it out! Thanks a lot! – ubaldo Nov 15 '16 at 07:54
0

Using UTF-8 as your character encoding should solve such problems. It may also remove the need for your conversion function. I'm not sure how to set the encoding in your web server, but that's usually well documented.

Wiebe
  • 106
  • 3
  • Thanks Wiebe. Unfortunately I cannot modify the character setting of the web server I call (at least I think I cannot). I wonder if there is a way to bypass the problem using a encoding function or something like that.... – ubaldo Nov 14 '16 at 20:26