|
Posted by afrinspray on 08/30/06 19:04
J.O. Aho wrote:
> This would give a smaller size than what it is, as characters like 'ö' or 'ø'
> would be one byte and not two bytes as they would be in utf8.
>
> $length = mb_strlen($utf8_string, 'latin1');
>
> this is a dirty trick to make the byte length instead of the string length,
> you read the utf string as iso, which makes the multibyte characters to
> counted as 2+ bytes instead of being one character (one byte).
>
> yeah, characters with ASCII values below 128 are one byte, while everyone one
> else is two or more bytes.
Thank you so much! Exactly what I was looking for.
Mike
Navigation:
[Reply to this message]
|