| mersonim | Post date: 2011-03-01 09:04 Hi
I'm struggling to read data from a web site which has special character not converted correctly by Notes.
In fact, the string is "FORLÌ|2000004708|14/02/2011" but I always get "FORL■2000004708|14/02/2011"
here below the script I wrote which also include utf-8 character conversion but it doesn't work.
is there anybody who already came across this problem and can give me some help?
thanks in advance.
mauro
Set HTTPBolle=CreateObject("Microsoft.XMLHTTP")
'### Leggo il link Web ###
annoBolle$=Cstr(Year(Today))
URLServerBolle$ = "http://mysitexxx:8080/" + annoBolle$ + "Bolle/"
URLBolle$ = URLServerBolle$ +FileBolleWeb$+"txt"
Call HTTPBolle.open("GET",URLBolle$,True)
' Header (doveva esser eun UTF-8 in get ma nn va
Call HTTPBolle.SetRequestHeader("Content-Type" , "text/xml;charset=utf-8")
Call HTTPBolle.SetRequestHeader("SoapAction", "http://schemas.xmlsoap.org/soap/envelope")
Call HTTPBolle.send(Null)
'### LEGGO IL FILE DAL LINK WEB ###
HTTPBolleTXT$=HTTPBolle.responseText
|
| Fredrik Stöckel | Post date: 2011-03-01 10:12 Do you know the charset of the site that you are accessing? You might end end up with a conversion problem if the site that you read data from uses a different charset than the charset that you prefer.
|
| mersonim | Post date: 2011-03-01 14:08 Hi Fredrik,
Thx for your reply.
I don't know the charset of the target site.
However, if I get data from there by using IE or the Notes Browser the result is correct.
I guess the problem is about the call to HTTP by creating an object type Microsoft.XMLHTTP
I found people asking in hundreds of forums but unfortunately for me none of them had a solution for Notes developers.
What do you think?
|
| Danne | Post date: 2011-03-01 14:14You can try and check what charset server is using for the data by using say FireBug in Mozilla.
You need to check the response headers directly as most browsers try and show/convert the data so it is readable in the charset you are using.
This for example is the response header for this thread in firebug.
| Server |
Lotus-Domino |
| Date |
Tue, 01 Mar 2011 13:09:11 GMT |
| Connection |
close |
| Content-Type |
text/html; charset=UTF-8 |
| Cache-Control |
max-age=0, no-cache, no-store, must-revalidate |
Try and check the source you are having problem with and see what the response headers say about the Character set. (install firebug and open the data source you are reading and inspect the call and see what the charset is)
|
| mersonim | Post date: 2011-03-02 08:19 Hi Danne,
the charset is ISO-8859-1. I have changed my script but still doesn't work.
any idea?
|
| Tomas Nielsen | Post date: 2011-03-04 12:56Hi!
What happens if you try to change:
Call HTTPBolle.SetRequestHeader("Content-Type" , "text/xml;charset=utf-8")
to
Call HTTPBolle.SetRequestHeader("Content-Type" , "text/xml;charset=ISO-8859-1")
Just a thought.
If you could align both sites to use the same encoding you should also get it to work.
|