#2626 closed Bug (Fixed)
ControlGetText wrong encoding for some words.
| Reported by: | anonymous | Owned by: | Jon |
|---|---|---|---|
| Milestone: | 3.3.13.3 | Component: | AutoIt |
| Version: | 3.3.11.2 | Severity: | None |
| Keywords: | Cc: |
Description (last modified by )
$gui=GUICreate("", 200, 100)
$id1=GUICtrlCreateCheckbox("Выполнение приложений", 5, 5)
$id2=GUICtrlCreateInput("Включить в группу", 5, 35)
$id3=GUICtrlCreateLabel("Сохранять пропорции", 5, 65)
GUISetState()
ConsoleWrite(ControlGetText($gui, "", GUICtrlGetHandle($id1)) & @LF)
ConsoleWrite(ControlGetText($gui, "", GUICtrlGetHandle($id2)) & @LF)
ConsoleWrite(ControlGetText($gui, "", GUICtrlGetHandle($id3)) & @LF)
Do
Until GUIGetMsg() = -3
In console and in Autoit v3 Windows Info on Visible Text tab the encoding of this text is wrong and show this:
K?>;=5=85
:;NG8BL
!>E@0=OBL
$text = ControlGetText($gui, "", GUICtrlGetHandle($id1)
$array = StringToASCIIArray($text)
array is:
Row|Col 0
[0]|18
[1]|4
[2]|75
[3]|4
[4]|63
[5]|4
[6]|62
[7]|4
[8]|59
[9]|4
[10]|61
[11]|4
[12]|53
[13]|4
[14]|61
[15]|4
[16]|56
[17]|4
[18]|53
[19]|4
[20]|32
But if now change id1 text to Выполнение приложений2 or add a couple of characters of any kind, for example Выполнение приложенийblabla or Выполнение the text begins to determine the correct.
Attachments (0)
Change History (9)
comment:1 by , 12 years ago
comment:2 by , 12 years ago
The same example, the text encoding utf-16
Local $atext_1 = [1042,1099,1087,1086,1083,1085,1077,1085,1080,1077,32,1087,1088,1080,1083,1086,1078,1077,1085,1080,1081]
Local $atext_2 = [1042,1082,1083,1102,1095,1080,1090,1100,32,1074,32,1075,1088,1091,1087,1087,1091]
Local $atext_3 = [1057,1086,1093,1088,1072,1085,1103,1090,1100,32,1087,1088,1086,1087,1086,1088,1094,1080,1080]
Local $gui=GUICreate("", 200, 100)
Local $id1=GUICtrlCreateCheckbox(StringFromASCIIArray($atext_1), 5, 5)
Local $id2=GUICtrlCreateInput(StringFromASCIIArray($atext_2), 5, 35)
Local $id3=GUICtrlCreateLabel(StringFromASCIIArray($atext_3), 5, 65)
GUISetState()
ConsoleWrite(ControlGetText($gui, "", GUICtrlGetHandle($id1)) & @LF)
ConsoleWrite(ControlGetText($gui, "", GUICtrlGetHandle($id2)) & @LF)
ConsoleWrite(ControlGetText($gui, "", GUICtrlGetHandle($id3)) & @LF)
Do
Until GUIGetMsg() = -3
comment:3 by , 12 years ago
ControlGetText wrong encoding
WinGetText() wrong encoding too
$gui=GUICreate("Диспетчер устройств", 300, 100)
GUISetState()
MsgBox(0, "", WinGetTitle($gui) & @LF)
comment:5 by , 12 years ago
| Description: | modified (diff) |
|---|
Definitly a bug detection of Unicode string is failing
comment:7 by , 12 years ago
I know where is the bug, Jon will fix it when he has time.
The blank id scridding up the Ansi/Unicode detectection
(It is the only one which can modify AutoIt Code)
Cheers
comment:8 by , 12 years ago
| Milestone: | → 3.3.13.3 |
|---|---|
| Owner: | set to |
| Resolution: | → Fixed |
| Status: | new → closed |
Fixed by revision [10314] in version: 3.3.13.3



the same is observed in Notepad.exe
If text is exactly Выполнение приложений no extra spaces and line breaks, this script gives an incorrect result:
MsgBox(0, "", ControlGetText("[class:Notepad]", "", "Edit1"))