If VAR <> ; false, while StrLen(VAR) > 0
Code: Select all
StringCaseSense Locale
VAR := ""
MsgBox % StrLen(VAR) ; 3 (3 zero-width spaces)
If VAR =
MsgBox Isn't this a bug
Code: Select all
StringCaseSense Locale
VAR := ""
MsgBox % StrLen(VAR) ; 3 (3 zero-width spaces)
If VAR =
MsgBox Isn't this a bug
Code: Select all
MsgBox % StrLen(VAR) ; 3 (3 zero-width spaces)
Code: Select all
q:: ;test zero-width characters with StringCaseSense Locale
StringCaseSense, Locale
;note: two invisible characters are listed here:
;8204 200C ZERO WIDTH NON-JOINER
;8205 200D ZERO WIDTH JOINER
VAR := Chr(8204) Chr(8205) Chr(8204)
MsgBox, % StrLen(VAR) ;3
if VAR =
MsgBox, 1 ;1
else
MsgBox, 0
if (VAR = "")
MsgBox, 1 ;1
else
MsgBox, 0
return
Code: Select all
s1 := "ab" ; there are 3 zero-width spaces in the middle
s2 := "ab" ; just as it appears
MsgBox % (DllCall("lstrcmpiW", "wstr", s1, "wstr", s2) ? "not" : "") " equal"
MsgBox % (DllCall("CompareStringEx", "ptr", 0, "uint", 0x10
, "wstr", s1, "int", -1, "wstr", s2, "int", -1
, "ptr", 0, "ptr", 0, "ptr", 0)=2 ? "" : "not") " equal"
Code: Select all
;4511 characters were regarded as equal to a blank string
q:: ;test StringCaseSense Locale, characters equal to a blank string
vOutput := ""
VarSetCapacity(vOutput, 100000*2)
StringCaseSense, Locale
vOutput := "", vCount := 0
Loop, 65535
if (Chr(A_Index) = "")
vOutput .= A_Index "`t" Chr(A_Index) "`r`n", vCount += 1
Clipboard := vCount "`r`n" vOutput
MsgBox, % Clipboard
return
Code: Select all
StringCaseSense Locale
X = �
If (X = "")
MsgBox Buggy 'StringCaseSense Locale' definitins
Users browsing this forum: No registered users and 39 guests