You are here: Re: String Size in Bytes « All PHP « IT news, forums, messages
Re: String Size in Bytes

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация