After a very long investigation, I have found a really ugly bug.
In recent months, I have received bug reports from customers that a certain feature was not working correctly.
Also read this:
I use uppercase to check if there are lowercase chars in a string.
var t as string = “Aef6V”
if StrComp( t , Uppercase(t) , 0) = 0 then
msbox "Does not contain lowercase chars"
else
msgbox "Does contain lowercase chars"
end
I could not reproduce this, which of course makes it difficult to find a bug and fix it.
After a lot of mails and phone calls, I found that only Chinese customers had the problem.
So I thought somewhere there was a problem with encoding strings. Well, that turned out not to be the problem.
However, after some more testing and cooperation with the Chinese customers, the error came to light. UPPERCASE does not work for the Chinese customers.
So this code gives an wrong result only for Chinese users.
Var x as string = "aabbBBcCdD".
Msgbox uppercase(x)
As expected, this returns a message box with “AABBBBCCDD”.
But for Chinese users, this returns “aabbBBcCdD” … WTF?
Anyone have an idea how this can happen? Admit … this can cause a lot of frustration when your program doesn’t work for some customers.
Addition:
As far as I know, this is only with Chinese users. Maybe there are others …
Kem did provide a solution using RegEx
Which I did use in another program - but not in the one I had issues.
var rx as new RegEx
rx.SearchPattern = "\p{Ll}"
if rx.Search( token ) isa RegExMatch then
// has lowercase
end if