php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #36024 Problem with unicode escape sequences in binary data
Submitted: 2006-01-16 00:35 UTC Modified: 2006-01-16 00:47 UTC
From: mauroi at digbang dot com Assigned:
Status: Suspended Package: Feature/Change Request
PHP Version: 5.1.2 OS: *
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mauroi at digbang dot com
New email:
PHP Version: OS:

 

 [2006-01-16 00:35 UTC] 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.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-01-16 00:42 UTC] mauroi at digbang dot com
I could send a patch with a sinonym for the not overloaded strlen function.... My two cents (and three lines :o) )

Thanks in advance.
 [2006-01-16 00:47 UTC] derick@php.net
This is definitely something for PHP 6 and its Unicode support.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 21:01:36 2024 UTC