Response text from XMLHTTP object, charset utf-8 to windows-1256 
Author Message
 Response text from XMLHTTP object, charset utf-8 to windows-1256

I use the XMLHTTP object in the following code.. in VB

......
Dim objXH As Object

    Set objXH = CreateObject("Microsoft.XMLHTTP")
   strURL = "http://localhost/Test/xmlhttptest.asp"

    objXH.open "get", strURL, False
    objXH.send

Text1.Text = CStr(objXH.responsetext)
..........

It works fine.. as long as all the text in the response
is 'English'. My Response page contains text, with a mix
of English and Arabic, but all the arabic characters come
out as '?????.?????'.

What i assume is that, the XMLHTTP object is not
automatically changing the encoding to show the non-
english characters correctly.

When I Display this asp page in IE, it shows up the same
way.. i.e the non-english characters, as '????.??' but,
when i right-click and from the popup-up menu, change the
encoding from 'utf-8' to 'Arabic (windows)' (which
actually would be 'Windows-1256', the arabic characters
are displayed correctly.

I guess if i could do something similar to what IE does to
this text, to the objXMLHTTP.responsetext, the arabic text
would display properly, but i can't find any VB function
that converts from 'utf-8' to 'windows-1256'.

Any Ideas, anyone.. please share..



Sun, 18 Dec 2005 01:49:25 GMT  
 Response text from XMLHTTP object, charset utf-8 to windows-1256

Quote:
>-----Original Message-----
>I use the XMLHTTP object in the following code.. in VB

>.......
>Dim objXH As Object

>    Set objXH = CreateObject("Microsoft.XMLHTTP")
>   strURL = "http://localhost/Test/xmlhttptest.asp"

>    objXH.open "get", strURL, False
>    objXH.send

>Text1.Text = CStr(objXH.responsetext)
>...........

>It works fine.. as long as all the text in the response
>is 'English'. My Response page contains text, with a mix
>of English and Arabic, but all the arabic characters come
>out as '?????.?????'.

>What i assume is that, the XMLHTTP object is not
>automatically changing the encoding to show the non-
>english characters correctly.

>When I Display this asp page in IE, it shows up the same
>way.. i.e the non-english characters, as '????.??' but,
>when i right-click and from the popup-up menu, change the
>encoding from 'utf-8' to 'Arabic (windows)' (which
>actually would be 'Windows-1256', the arabic characters
>are displayed correctly.

>I guess if i could do something similar to what IE does
to
>this text, to the objXMLHTTP.responsetext, the arabic
text
>would display properly, but i can't find any VB function
>that converts from 'utf-8' to 'windows-1256'.

>Any Ideas, anyone.. please share..

>.



Sun, 18 Dec 2005 13:36:17 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. XMLHTTP/Response.BinaryWrite to browser

2. Convert UTF-16 Unicode to UTF-8 Unicode?

3. How do I write a text file in utf-8 charset ?

4. How do I write a text file in utf-8 charset ?

5. How do you change the CharSet property of a text box

6. ADO stream object and charset property and internet publishing

7. Help with converting Windows Unicode (UCS-2) to Oracle Unicode (UTF-8) via ADO

8. Macro to Print Text to file in UTF-8

9. Create text file in vb (save it as UTF-8)

10. Save file as UTF-8 in VB. (with file system object)

11. Font object Charset constants

12. XMLHTTP object in ASP page

 

 
Powered by phpBB® Forum Software