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

Change History (2)

comment:1 Changed 13 years ago by jchd

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 Changed 13 years ago by guinness

  • Milestone set to 3.3.9.5
  • Owner set to guinness
  • Resolution set to Fixed
  • Status changed from new to closed

Fixed by revision [7377] in version: 3.3.9.5

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

Author


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

 
Note: See TracTickets for help on using tickets.