As I understand it the String class will handle utf-8 properly, when
completed, so you could wait...

You could override the necessary validation methods either in AppModel
or a behavior - since these are checked before the methods on the
actual Validation class.
For example, the Validation::between() method looks like this:

class Validation extends Object {
        function between($check, $min, $max) {
                $length = strlen($check);

                if ($length >= $min && $length <= $max) {
                        return true;
                } else {
                        return false;
                }
        }
}

so you can do this:

class AppModel extends Model {
        function between($check, $min, $max) {
                $length = mb_strlen($check, 'UTF-8');

                if ($length >= $min && $length <= $max) {
                        return true;
                } else {
                        return false;
                }
        }
}

And so on...

Alternatively, you can configure PHP to transparently map calls to
"normal" string functions to the multibyte ones. I've never done this,
so I'm not sure how it works, but you can read up about it here :
http://uk2.php.net/manual/en/ref.mbstring.php#mbstring.overload

On Dec 18, 3:24 pm, Amit <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm creating my first cakephp (1.2) project.
> Without changing any default settings, I see that string length
> validation functions (between, maxLength...) don't work properly with
> multilingual input.
> What should I do to make them work?
>
> Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to