Modify

Opened 13 years ago

Closed 13 years ago

#2268 closed Bug (Fixed)

_StringReverse()

Reported by: anonymous Owned by: guinness
Milestone: 3.3.9.5 Component: AutoIt
Version: 3.3.8.1 Severity: None
Keywords: Cc:

Description

Check _StringReverse() For Chinese, Korean, Japanese, similar characters.

Currently _StringReverse() does not work on unicode characters. If used then CPU Usage = 100%.

Previous _StringReverse() ( no dll ) one worked correctly

Attachments (0)

Change History (2)

comment:1 by jchd, 13 years ago

Correct. Unless I'm wrong the function should be using wchar and _wcsrev, not char and _strrev:

Func _StringReverse($s_String)

	Local $i_len = StringLen($s_String)
	If $i_len < 1 Then Return SetError(1, 0, "")

	Local $t_chars = DllStructCreate("wchar[" & $i_len + 1 & "]")
	DllStructSetData($t_chars, 1, $s_String)

	Local $a_rev = DllCall("msvcrt.dll", "ptr:cdecl", "_wcsrev", "struct*", $t_chars)
	If @error Or $a_rev[0] = 0 Then Return SetError(2, 0, "")

	Return DllStructGetData($t_chars, 1)
EndFunc   ;==>_StringReverse

comment:2 by guinness, 13 years ago

Milestone: 3.3.9.5
Owner: set to guinness
Resolution: Fixed
Status: newclosed

Fixed by revision [7377] in version: 3.3.9.5

Modify Ticket

Action
as closed The owner will remain guinness.

Add Comment


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