Reply to Re: binary string length

Your name:

Reply:


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-----

[Back to original 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

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