Jump to content

Recommended Posts

Posted

I'm trying to retrieve page which have unicode characters. After getting the source by using "_IEDocReadHTML", the texts are broken and I have found out that the unicode in the HTML source of IE.au3 is not match to the one generated by IE. Can anybody help me please ? Thanks so much.

Posted

Can you please create and post a very simple reproducer that demonstrates the issue?

Thanks.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Posted (edited)

Here I have attached 2 files, the f1.htm is the original with Unicode and the f2.htm is the copy of IE.au3, which is broken. Can you take a look at it please ? Thanks.

autoit.zip

Edited by Who
Posted

Am I doing something wrong? I opened both files in IE and they both contain a short string of characters I cannot read:

ặùưẫạèàêđâịôáđêôô

and

?ùu??èàêdâ?ôádêôô

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Posted (edited)

It's an example I have used. The f1.htm is 44b while the f2.htm is only 18b. And you can see the different in these screenshots I have uploaded here.

#include <File.au3>
#include <IE.au3>
$oIE = _IECreate("f1.htm", 0, 1, 1, -1)
$sHTML = _IEDocReadHTML($oIE)
_IEQuit($oIE)
$file = FileOpen("f2.htm", 2)
FileWrite($file,$sHTML)
FileClose($file)

post-25207-1198988864_thumb.jpg

post-25207-1198988871_thumb.jpg

Edited by Who
Posted

This has nothing to do with IE.au3

The following produces the same result:

$f1 = fileopen("f1.htm", 0)
$f3 = fileopen("f3.htm", 2)
$line = FileReadLine ($f1)
FileWriteLine ($f3, $line)

Please see the modes for FileOpen

Mode (read or write) to open the file in.

Can be a combination of the following:

0 = Read mode

1 = Write mode (append to end of file)

2 = Write mode (erase previous contents)

4 = Read raw mode

8 = Create directory structure if it doesn't exist (See Remarks).

16 = Force binary(byte) reading and writing mode with FileRead and FileWrite

32 = Use Unicode UTF16 Little Endian mode when writing text with FileWrite and FileWriteLine (default is ANSI)

64 = Use Unicode UTF16 Big Endian mode when writing text with FileWrite and FileWriteLine (default is ANSI)

128 = Use Unicode UTF8 when writing text with FileWrite and FileWriteLine (default is ANSI)

Both write modes will create the file if it does not already exist. The folder path must already exist (except using mode '8' - See Remarks).

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Posted

Ar ah oh, I see. Sorry for my stupid question. Hope you will not find it unpleasant. Anyway, thank you very much for your help.

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
×
×
  • Create New...