Doc #55668 [NEW]: Strings docs: explain that strings are binary safe
| From: | php at richardneill dot org | Date: | Sun, 11 Sep 2011 13:34:44 +0000 |
| Subject: | Doc #55668 [NEW]: Strings docs: explain that strings are binary safe | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-7167@lists.php.net to get a copy of this message | ||
From:
Operating system:
PHP version: Irrelevant
Package: Documentation problem
Bug Type: Documentation Problem
Bug description:Strings docs: explain that strings are binary safe
Description:
------------
I think there are a couple of omissions that could be added to the notes
here:
http://www.php.net/language.types.string
1. Clarify that, unlike C-strings, PHP-strings are properly binary safe,
i.e. not internally null-terminated, and can include embedded \0. One
might otherwise wrongly expect that, for example strlen("hello\0world")
would be 5.
2. The reference to PHP's strings not being natively Unicode is a bit
confusing: a string is just a sequence of bytes, and doesn't, conceptually,
even have a character set! UTF-8 is already transparently ASCII compatible
as a byte-stream. It's just certain functions (strlen, strtolower etc) that
can't cope.
[May I suggest a reference to the UTF-8 FAQ:
http://www.cl.cam.ac.uk/~mgk25/unicode.html )
--
Edit bug report at https://bugs.php.net/bug.php?id=55668&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=55668&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=55668&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=55668&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=55668&r=fixed
Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=55668&r=needdocs
Fixed in release: https://bugs.php.net/fix.php?id=55668&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=55668&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=55668&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=55668&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=55668&r=support
Expected behavior: https://bugs.php.net/fix.php?id=55668&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=55668&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=55668&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=55668&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=55668&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=55668&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=55668&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=55668&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=55668&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=55668&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=55668&r=mysqlcfg