Modify

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#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 J-Paul Mesnage)

$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 anonymous, 12 years ago

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"))

comment:2 by anonymous, 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 anonymous, 12 years ago

ControlGetText wrong encoding

WinGetText() wrong encoding too

$gui=GUICreate("Диспетчер устройств", 300, 100)
GUISetState()
MsgBox(0, "", WinGetTitle($gui) & @LF)

comment:4 by anonymous, 12 years ago

And WinGetTitle() too (see example above)

comment:5 by J-Paul Mesnage, 12 years ago

Description: modified (diff)

Definitly a bug detection of Unicode string is failing

comment:6 by anonymous, 12 years ago

Some screenshots to show the bug.

ControlTAB
http://s58.radikal.ru/i162/1403/f7/ef46691def8f.png
Visible Text
http://s019.radikal.ru/i616/1403/e6/ab40c8311537.png

comment:7 by J-Paul Mesnage, 12 years ago

I know where is the bug, Jon will fix it when he has time.
The blank in the id is scrudding up the Ansi/Unicode detectection
(It is the only one which can modify AutoIt Code)
Cheers

Last edited 12 years ago by J-Paul Mesnage (previous) (diff)

comment:8 by Jon, 12 years ago

Milestone: 3.3.13.3
Owner: set to Jon
Resolution: Fixed
Status: newclosed

Fixed by revision [10314] in version: 3.3.13.3

comment:9 by Jon, 12 years ago

Fixed by revision [10316] in version: 3.3.13.3

Modify Ticket

Action
as closed The owner will remain Jon.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.