ID: 47164
Updated by: [email protected]
Reported By: lunter at interia dot pl
Status: Open
Bug Type: Unicode Engine related
Operating System: all
PHP Version: 6CVS-2009-01-20 (snap)
New Comment:
$b = sprintf("%c%c%c", 255, 254, 253);
should work, but having a simple function might still be helpful
Previous Comments:
------------------------------------------------------------------------
[2009-01-21 11:12:52] [email protected]
Actually we need a function doing "binary chr" - chr() in PHP 6 takes a
codepoint not the byte value, so (binary)chr($c) will give the wrong
result.
------------------------------------------------------------------------
[2009-01-20 10:59:03] lunter at interia dot pl
Description:
------------
uncomfortable (binary)char() append to a binary string
Reproduce code:
---------------
$b=(binary)'';
$b.=chr(255);
$b.=chr(254);
$b.=chr(253);
$b.=chr(252);
$b.=chr(251);
...
$b.=chr(0);
Expected result:
----------------
detect $b type as binary string and adding chr() in binary mode
like this:
$b=(binary)'';
$b.=(binary)chr(255);
$b.=(binary)chr(254);
$b.=(binary)chr(253);
$b.=(binary)chr(252);
$b.=(binary)chr(251);
...
$b.=(binary)chr(0);
Actual result:
--------------
adding chr() in unicode
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=47164&edit=1