#36024 [Opn]: Problem with unicode escape sequences in binary data
| From: | mauroi at digbang dot com | Date: | Sun, 15 Jan 2006 23:42:59 +0000 |
| Subject: | #36024 [Opn]: Problem with unicode escape sequences in binary data | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-91973@lists.php.net to get a copy of this message | ||
ID: 36024
User updated by: mauroi at digbang dot com
Reported By: mauroi at digbang dot com
Status: Open
Bug Type: Feature/Change Request
Operating System: *
PHP Version: 5.1.2
New Comment:
I could send a patch with a sinonym for the not overloaded strlen
function.... My two cents (and three lines :o) )
Thanks in advance.
Previous Comments:
------------------------------------------------------------------------
[2006-01-16 00:35:31] mauroi at digbang dot com
Description:
------------
This is not a bug itself, but it's a problem that I run into often
because I develop unicode applications with mbstring overloading
functions.
Whenever I try to know the length of binary information (for example, a
lob retrieved from the database, in order to set the content-length
header) I get errors because raw bytes inside the variable are
interpreted as unicode escape sequences. So the length returned by
strlen is less than the correct one.
See Bug #35412 for a similar situation (there might be more).
In that cases I use mb_strlen($str, 'ASCII') but it would be nice to
have a function called bytecount or something like that.
Maybe there are already plans for this in PHP6 with the new unicode
thing.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=36024&edit=1