mIRC Home    About    Download    Register    News    Help

Topic Options
#220537 - 17/04/10 08:45 PM [7.xx] Bug in $regml().pos
zati Offline
Self-satisified door

Registered: 15/12/02
Posts: 4
$regml().pos counts 2 characters for each UTF-8 character.

To reproduce this bug, add this alias

Code:
alias test {
  var %num = $regex(mts,$1-,/(<[-_.a-zA-Z0-9]+>)/g)
  while (%num >= 1) {
    echo ** $regml(mts,%num) * $regml(mts,%num).pos
    dec %num
  }
}

Then type

Code:
/test test้ <t> <a>


Results in mIRC 7.xx :
Code:
** <a> * 12
** <t> * 8


Results in mIRC 6.xx
Code:
** <a> * 11
** <t> * 7
_________________________
http://www.zatiscript.com

Top
#220539 - 17/04/10 08:57 PM Re: [7.xx] Bug in $regml().pos [Re: zati]
Collective Offline
Planetary brain

Registered: 10/12/02
Posts: 3138
Loc: London, UK
The difference there is that mIRC 6.35 is not UTF-8-encoding the text before passing it to the regular expression engine. If you were to use $utfencode() in 6.35 you'd get the same result as on 7.01.

Top
#220595 - 19/04/10 12:46 PM Re: [7.xx] Bug in $regml().pos [Re: Collective]
zati Offline
Self-satisified door

Registered: 15/12/02
Posts: 4
Since $len() and $pos() reports correct length/position, I think $regml().pos should be corrected to be consistent with other identifiers.
_________________________
http://www.zatiscript.com

Top
#220766 - 23/04/10 05:00 PM Re: [7.xx] Bug in $regml().pos [Re: zati]
Khaled Offline


Planetary brain

Registered: 04/12/02
Posts: 4437
Loc: London, UK
Thanks this has been fixed for the next version.

Top