Modify

Opened 10 years ago

Closed 10 years ago

Last modified 10 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 Jpm)

$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 Changed 10 years ago by anonymous

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 Changed 10 years ago by anonymous

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 Changed 10 years ago by anonymous

ControlGetText wrong encoding

WinGetText() wrong encoding too

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

comment:4 Changed 10 years ago by anonymous

And WinGetTitle() too (see example above)

comment:5 Changed 10 years ago by Jpm

  • Description modified (diff)

Definitly a bug detection of Unicode string is failing

comment:6 Changed 10 years ago by anonymous

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 Changed 10 years ago by Jpm

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 10 years ago by Jpm (previous) (diff)

comment:8 Changed 10 years ago by Jon

  • Milestone set to 3.3.13.3
  • Owner set to Jon
  • Resolution set to Fixed
  • Status changed from new to closed

Fixed by revision [10314] in version: 3.3.13.3

comment:9 Changed 10 years ago by Jon

Fixed by revision [10316] in version: 3.3.13.3

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The owner will remain Jon.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.