[eluser]Skuja[/eluser]
Validation library length rules returns invalid length for non-latin utf8 characters.
For example if i set rule max_length[2] for a field and try to validate data: "šķ" it returns invalid length error.
Does anybody has good workaround for this, or should i add callback function each time on validation?
EDITED: I replaced native Validation library with my modified version, where i replaced
with
Code:
mb_strlen($str,'utf8')
in lines 433, 452, 471. And it works fine.
PS. I have read that mb_strlen function is slow. Maybe anyone has found better solution?