Doc #55668 [Asn->Csd]: Strings docs: explain that strings are binary safe

From: Date: Sun, 11 Sep 2011 20:15:09 +0000
Subject: Doc #55668 [Asn->Csd]: Strings docs: explain that strings are binary safe
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-7169@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=55668&edit=1 ID: 55668 Updated by: cataphract@php.net Reported by: php at richardneill dot org Summary: Strings docs: explain that strings are binary safe -Status: Assigned +Status: Closed Type: Documentation Problem Package: Documentation problem PHP Version: Irrelevant Assigned To: cataphract Block user comment: N Private report: N New Comment: This bug has been fixed in the documentation's XML sources. Since the online and downloadable versions of the documentation need some time to get updated, we would like to ask you to be a bit patient. Thank you for the report, and for helping us make our documentation better. Previous Comments: ------------------------------------------------------------------------ [2011-09-11 20:13:50] cataphract@php.net Automatic comment from SVN on behalf of cataphract Revision: http://svn.php.net/viewvc/?view=revision&revision=316504 Log: - Fixed doc bug #55668: trings docs: explain that strings are binary safe. - Strings & encodings. ------------------------------------------------------------------------ [2011-09-11 13:34:44] php at richardneill dot org 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 this bug report at https://bugs.php.net/bug.php?id=55668&edit=1

« previous php.doc.bugs (#7169) next »