Bug #64424 [NEW]: number_format is not multibyte safe
| From: | mwalker at wikimedia dot org | Date: | Thu, 14 Mar 2013 01:26:36 +0000 |
| Subject: | Bug #64424 [NEW]: number_format is not multibyte safe | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-177769@lists.php.net to get a copy of this message | ||
From: mwalker at wikimedia dot org
Operating system: Ubuntu 12.04
PHP version: 5.3.22
Package: *Unicode Issues
Bug Type: Bug
Bug description:number_format is not multibyte safe
Description:
------------
I have a UTF-8 PHP file that initializes an array of characters depending
on the
locale. Some of these are multibyte strings.
When using the number_format() function with $dec_point, or $thousands_sep
set
with one of these multibyte entries the returned result contains only the
first
byte of the string (which is only a partial code point.)
Test script:
---------------
$foo = "\xC2\xA0";
$result = number_format(1.23, $foo, $foo);
Expected result:
----------------
$result to contain "\x31\xC2\xA0\x32\x33"
Actual result:
--------------
$result seems to contain "\x31\xC2\x32\x33"
--
Edit bug report at https://bugs.php.net/bug.php?id=64424&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=64424&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=64424&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=64424&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=64424&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=64424&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=64424&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=64424&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=64424&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=64424&r=support
Expected behavior: https://bugs.php.net/fix.php?id=64424&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=64424&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=64424&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=64424&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64424&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=64424&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=64424&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=64424&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=64424&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=64424&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=64424&r=mysqlcfg