Hi! perform a phpinfo()
script, do you have mbstring extension installed and enabled?
The problem is that in UTF-8 (I am guessing that you are using it) in some situations to encode 1 sign you need more than 1 byte. There are so many signs world wide like latin, arabic, chinese, japanese, hebrew, cyrillic, math, chemical, phisics signs, etc. that 8 bits are not enough to encode everything. That is why sometimes (problalby with arabic letters) in UTF-8 a sign is encoded in more than one succeeding bytes. It could be e.g. 3 bytes. That is why when you type an SMS with a special letter (non english e.g. ź
, š
) you can type only 70 signs in 1 message instead of 160.
Example: كونراد
has 6 letters but it is encoded in 12 bytes.
So the strlen()
function in PHP does not count number of signs but it counts number of bytes. That's why strlen()
will count 6. You need to use a function mb_strlen from mbstring extension. mb_strlen()
function will count 12.
I have found now that Phalcon is checking if mb_strlen()
function is available. See here. If it's not it will use simple strlen()
.
So I am guessing that you should install/enable the mbstring extension and mb_strlen()
function will be available.