Re: Byte size of text?
| From: | Marek Kilimajer | Date: | Wed, 08 Sep 2004 09:07:08 +0000 |
| Subject: | Re: Byte size of text? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-196109@lists.php.net to get a copy of this message | ||
Rasmus Lerdorf wrote:
On Wed, 8 Sep 2004, Marek Kilimajer wrote:John asked for byte count, not character count. So he cannot use mb_strlen().John Smith wrote:mbstring can overload strlen and give you the correct character count for the various encodings. See php.net/mbstringWhat's the most accurate way to get the byte count of some text? Is strlen() accurate with Unicode, ASCII, etc.? Johnstrlen() is fine even for multibyte encodings, it does not know about encoding and returns the "raw" size. If you wanted the number of characters, you would need multibyte support.