It's just false, at least up to php5. Only iconv and mb_string functions take care of charset, so what you say is true for mb_strlen() with utf8 for example.Moriddin wrote:But a utf 8 character can differ from size 1 bytes to 4 bytes (according to the unicode value) you can't use strlen for the datasize
explained here http://nl.php.net/manual/en/function.strlen.php#72274.
strlen is a string manipulation function so this will return the number of characters. UTF8 is an storage/tranport encoding and you have to calculate the size in bytes of the utf8 string (also explained there).
With php6 it will really be a problem anyway it seems, i just don't know how a byte based string/buffer will have to be handled, btw it's not for tomorrow.