Jump to content

Http1.1 TCPRecv Unicode issue.


Recommended Posts

hey guys,

The thing is, i have a MySQL DB that contains all sorts of 'Text' data which is saved in a UTF-8 UNICODE format [in the DB] now all i want to do is pull that data out of the MySQL DB and 'Echo' it to autoit.

Now... there is no issue while 'Echo'ing it... it works just fine through a browser... i can switch that page's encoding into UTF-8 and it's all readable and fine...

however when i try pulling this page through AU3 it seems like the HTTP1.1 TCPRecv is failing...

i've also tried using:

htmlentities($OutPut, ENT_NOQUOTES, "UTF-8")

before the "php" echo but it yet seems to fail...

Any pointers?!

P.S

-> seems like there are issues always and only if the "Echo"ed string text is in fact UNICODED and not a simple eng text.

-> everything works fine as i go to that page through the browser... only Au3 is making trouble...

[u]My Au3 Scripts:[/u]____________(E)Lephant, A Share download manager (RS/MU etc)Http1.1 Console, The Ez Way!Internet Reconnection Automation Suite & A Macro Recording Tool.SK's Alarm Clock, Playing '.MP3 & .Wav' Files._________________Is GOD a mistake of the Humanity Or the Humanity is a mistake of GOD ?!

Link to comment
Share on other sites

The PHP part is working all ok i think [since it does spit the data into the browser when accessed by the browser] but i think that there is some issues with sending the data via HTTP1.1 to the AU3 script...

while i'm running TCPRecv on the script the script is waiting, waiting and then tells me that the server has timed out with only just a part of the package sent.... any idea?

please guys... anything to hold on to ?!

[u]My Au3 Scripts:[/u]____________(E)Lephant, A Share download manager (RS/MU etc)Http1.1 Console, The Ez Way!Internet Reconnection Automation Suite & A Macro Recording Tool.SK's Alarm Clock, Playing '.MP3 & .Wav' Files._________________Is GOD a mistake of the Humanity Or the Humanity is a mistake of GOD ?!

Link to comment
Share on other sites

I dont know if it can help you, but this script works for me:

#include <IE.au3>

$URL = StringSplit("www.yahoo.com","/")
$Path = "/"
For $i = 2 to $URL[0]
    $Path = $Path&$URL[$i]&"/"
Next

TCPStartup()
Main()
TCPShutdown()

Func Main()
    Local $IP = TCPNameToIP($URL[1])
    If @error Then
        ConsoleWrite("Error: Unable to resolve hostname" & @CRLF)
        Return -1
    EndIf

    Local $socket = TCPConnect($IP, 80)
    If @error Then
        ConsoleWrite("Error: Unable to open socket" & @CRLF)
        Return -2
    EndIf

    TCPSend($socket, "GET "&$Path&" HTTP/1.1" &@CRLF&"Host: "&$URL[1] & @LF & @LF)


    $File = FileOpen(@DesktopDir&"\Page.html",2)
    FileClose($File)

    
    Local $sText
    Local $Total
    Local $Count = 300
    
    While 1
        $sText = TCPRecv($socket, 2048)

        If $sText = "" Then
            $Count -= 1
            if $Count = 0 Then ExitLoop
        Else
            $Total &= $sText
        EndIf
    WEnd
    
    $File = FileOpen(@DesktopDir&"\Page.html",1)
    FileWrite($File,$Total)
    FileClose($File)
    
    $IE = _IECreate(@DesktopDir&"\Page.html")
    
EndFunc
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...