mIRC Home    About    Download    Register    News    Help

Print Thread
#261784 24/11/17 07:07 PM
Joined: Aug 2016
Posts: 57
R
Babel fish
OP Offline
Babel fish
R
Joined: Aug 2016
Posts: 57
I have encountered some problems with mIRC by distinguishing between uppercase and lowercase Latin letters in case-insensitive comparisons and token identifiers.

I used as an example only a few letters, but the problem occurs with others as well.

Code:
//if (Ã == ã) { echo -a $true } | else { echo -a $false }
//if (É == é) { echo -a $true } | else { echo -a $false }
//if (Ô == ô) { echo -a $true } | else { echo -a $false }
//if (Ñ == ñ) { echo -a $true } | else { echo -a $false }
//if (Ç == ç) { echo -a $true } | else { echo -a $false }

All of these examples return $false, but should return $true


Code:
//if ($lower(Ã) === ã) { echo -a $true } | else { echo -a $false }
//if ($lower(É) === é) { echo -a $true } | else { echo -a $false }
//if ($lower(Ô) === ô) { echo -a $true } | else { echo -a $false }
//if ($lower(Ñ) === ñ) { echo -a $true } | else { echo -a $false }
//if ($lower(Ç) === ç) { echo -a $true } | else { echo -a $false }

Now they return $true, because $lower converts correctly.



Code:
//if (Ã === $upper(ã)) { echo -a $true } | else { echo -a $false }
//if (É === $upper(é)) { echo -a $true } | else { echo -a $false }
//if (Ô === $upper(ô)) { echo -a $true } | else { echo -a $false }
//if (Ñ === $upper(ñ)) { echo -a $true } | else { echo -a $false }
//if (Ç === $upper(ç)) { echo -a $true } | else { echo -a $false }

In these examples they also return $true, because the $upper also converts correctly.

Here a code with more letters:
Code:
//var %l = à á â ã ä å è é ê ë ì í î ï ò ó ô õ ö ù ú û ü ç ñ,%x = 1 | while (%x <= $numtok(%l,32)) { if ($gettok(%l,%x,32) == $upper($gettok(%l,%x,32))) { echo -a $v1 == $v2 } | else { echo -a $v1 != $v2 } | inc %x }

return:
à != À
á != Á
â != Â
ã != Ã
ä != Ä
å != Å
è != È
é != É
ê != Ê
ë != Ë
ì != Ì
í != Í
î != Î
ï != Ï
ò != Ò
ó != Ó
ô != Ô
õ != Õ
ö != Ö
ù != Ù
ú != Ú
û != Û
ü != Ü
ç != Ç
ñ != Ñ
The return should be all v1 == v2. It would only be v1 !== v2 if it were ===


Demonstrating error in $istok
Code:
//var %l = à á â ã ä å è é ê ë ì í î ï ò ó ô õ ö ù ú û ü ç ñ,%x = 1 | while (%x <= $numtok(%l,32)) { if ($istok(%l,$upper($gettok(%l,%x,32)),32)) { echo -a $v1 } | else { echo -a $v1 } | inc %x }

However, it should return everything $true. The return should be all $false if it were $istokcs


Now problem with $addtok that repeats with all other token identifiers
Code:
//var %token = ã | echo -a $addtok(%token,Ã,32)

In this example you should not add

Code:
//var %token = ã | echo -a $addtokcs(%token,Ã,32)

Already in this example you must add, as was added


I will not be demonstrating a lot of examples with all token identifiers as there is no need.


rockcavera
#Scripts @ irc.VirtuaLife.com.br
Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
This has been reported multiple times, it's a known issues with mIRC not using full case folding for default caseless matching.
A thread with Khaled's reply: https://forums.mirc.com/ubbthreads.php/ubb/showflat/Number/256132/
First thread where the bug was reported: https://forums.mirc.com/ubbthreads.php/ubb/showflat/Number/240374


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Aug 2016
Posts: 57
R
Babel fish
OP Offline
Babel fish
R
Joined: Aug 2016
Posts: 57
Thank you for the informations.


rockcavera
#Scripts @ irc.VirtuaLife.com.br

Link Copied to Clipboard