Opened 13 years ago
Closed 13 years ago
#2362 closed Bug (Fixed)
ControlGetText, WinGetTitle sometimes reads ANSI as Wide
| Reported by: | Owned by: | Jon | |
|---|---|---|---|
| Milestone: | 3.3.9.11 | Component: | AutoIt |
| Version: | 3.3.9.10 | Severity: | None |
| Keywords: | Cc: |
Description
Sometimes ControlGetText or WinGetTitle will return characters that display as a mess of '?'s (in Console output). This is because of an issue with SendMessage with WM_GETTEXT. Windows will sometimes return ANSI strings, and return the # of bytes rather than characters. AutoIt internally assumes this is Unicode and treats it as such - so it displays incorrectly.
To overcome this problem, zero out a buffer, fill it with WM_GETTEXT, then do a simple wcslen() on the return to compare it to the length that WM_GETTEXT returns. It should be roughly half the size if it is an ANSI string (you need to take into account odd # returns here).
I wrote script code that works around this problem, see:
www.autoitscript.com/forum/topic/148411-fix-for-unreadable-text-from-wingettext-controlgettext/
Attachments (0)
Change History (1)
comment:1 by , 13 years ago
| Milestone: | → 3.3.9.11 |
|---|---|
| Owner: | set to |
| Resolution: | → Fixed |
| Status: | new → closed |

Fixed by revision [8072] in version: 3.3.9.11