php-i18n Digest 25 Mar 2004 14:27:55 -0000 Issue 220
Topics (messages 677 through 677):
Re: String length
677 by: Hayk Chamyan
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
Hi,
On Monday, February 9, 2004, 9:25:47 PM, Moriyoshi Koizumi:
MK> You can use mb_orig_strlen() where the byte-wise behaviour is
MK> needed, when strlen() is overloaded by mb_strlen(). The same applies to
MK> other mbstring counterparts (e.g. substr() - mb_substr() - mb_orig_substr()).
MK> This is an undocumented feature though.
MK> BTW, while it's found useful sometimes, it's also discouraged to use
MK> function overloading as strlen() is the only reasonable way to
MK> retrieve the length of a binary object in bytes at this time. I
MK> couldn't assure this, but sizeof() / count() will likely replace
MK> that functionality of strlen() and strlen() will probably be used
MK> solely to get the actual character count.
I know about undocumented feature - mb_orig_* functions. And I know
that count()/sizeof() returns the number elements in array, for all
other types it returns 1.
I suggest adding a function, which returns the length of a binary
object in bytes, in MB String module to use that function with
filesystem, network and other functions which handle binary data.
--- End Message ---