• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLUTION FOUND]Validation library has incorrect length rules for non-latin utf8 characters

#1
[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
Code:
strlen($str)
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?


Messages In This Thread
[SOLUTION FOUND]Validation library has incorrect length rules for non-latin utf8 characters - by El Forum - 03-28-2008, 02:32 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.