Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Does Phalcon\Mvc\Model\Validator\StringLength check multibyte length?

I'm wondering if Phalcon\Mvc\Model\Validator\StringLength checks for multibyte length using something like the mb_strlen function for the international market. If not then perhaps there should be an option for enabling that.

In my case I'm setting the database varchar field higher than the number of actual symbols that I want to allow. Then that validation is done with Phalcon.

edited Feb '15

Well if you are using Phalcon 2 and you have installed mb extension the answer is yes

That is cool in a way but its also kind of scary that it can be inconsistent like that. I think that the behaviour should only change like that based upon an option and then to throw an exception if it can't do what it is trying to do.

One of these days I'll just start reading Zephir source code when I have a question.