|
Posted by Edward Z. Yang on 05/28/07 19:19
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Andy Hassall wrote:
> No, that's not the case - PHP strings are stored with both the length and the
> data, unlike C strings that just has one pointer and uses a terminator. They're
> "binary-safe" - NUL doesn't terminate the string. [snip]
Andy is correct. By default, PHP strings are treated like binary
strings, which works great for 8-bit encodings but not so much for UTF-8
or other multibyte character encodings. mbstring tries to "fix" this
using the automatic string overload, but then you lose the ability to
process binary data.
- --
Edward Z. Yang GnuPG: 0x869C48DA
HTML Purifier <htmlpurifier.org> Anti-XSS HTML Filter
[[ 3FA8 E9A9 7385 B691 A6FC B3CB A933 BE7D 869C 48DA ]]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGWytBqTO+fYacSNoRAgcBAJ9FrhQ62Z6HVRFBgOKwiXIiciAZjACfXhL4
A9uNj8G02gyQOOpp1Q/vVhs=
=xbaE
-----END PGP SIGNATURE-----
Navigation:
[Reply to this message]
|