Jump to content
Sign in to follow this  
Chefito

winhttp don't show well the letters with accents.

Recommended Posts

Chefito

Hi,

I am having problems trying to retrieve the code HTML from a website. the letters with accents and the letter ñ don´t show well. For example,

I see this: Guía local de comercios en Argentina - Guía Local

and I would have to see this: Guía local de comercios en Argentina - Guía Local.

It happens with all the text html.

I am using winhttp udf. What I can do? Any idea?

My code:

#include <WinHTTP.au3>
$hOpen = _WinHttpOpen()
$hConnect = _WinHttpConnect($hOpen, "guialocal.com.ar")
$html = _WinHttpSimpleRequest($hConnect, "get")
ConsoleWrite($html)
; Close handles
_WinHttpCloseHandle($hConnect)
_WinHttpCloseHandle($hOpen)
Edited by Chefito

Share this post


Link to post
Share on other sites
Exit

#include <WinHTTP.au3> seems to handle no codepages.

#include <ie.au3> works fine.

Run the following code and see the resulting messagebox.

#include <WinHTTP.au3>
$hOpen = _WinHttpOpen()
$hConnect = _WinHttpConnect($hOpen, "guialocal.com.ar")
$html = _WinHttpSimpleRequest($hConnect, "get")
ConsoleWrite($html)
; Close handles
_WinHttpCloseHandle($hConnect)
_WinHttpCloseHandle($hOpen)
$title1 = _StringBetween($html, "<title>", "</title>")

#include <ie.au3>
#include <string.au3>
$oIE = _IECreate("guialocal.com.ar", Default, 0)
$html = _IEDocReadHTML($oIE)
ConsoleWrite($html)
_IEQuit($oIE)
$title2 = _StringBetween($html, "<title>", "</title>")
MsgBox(262144, " Titles ", $title1[0] & @LF & $title2[0])

My UDFs, Abbrevs and Snippets
If you like my post, just click the like button :) 

Share this post


Link to post
Share on other sites
Chefito

Exit, thank, but it isn't that I want to do. Also, I don't want to use the ie.au3 udf. I could do it for example with _iebodyreadtext, but I want to know as it do with winhttp.

Thank you very much ;).

Trancexx, I have read many post from you and I know that you are a genius ;).

Your solution works perfectly!!!!! :). I was that I wanted. I never would have guessed it was that parameter. Thank you very very much.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×