Doc #53113 [Opn->Csd]: number_format(): wrong usage of term "character" in multi-byte context
| From: | kalle@php.net | Date: | Fri, 22 Oct 2010 02:05:14 +0000 |
| Subject: | Doc #53113 [Opn->Csd]: number_format(): wrong usage of term "character" in multi-byte context | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-5313@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=53113&edit=1
ID: 53113
Updated by: kalle@php.net
Reported by: alex dot schuch at gmx dot de
Summary: number_format(): wrong usage of term "character" in
multi-byte context
-Status: Open
+Status: Closed
Type: Documentation Problem
Package: Documentation problem
Operating System: -
PHP Version: Irrelevant
-Assigned To:
+Assigned To: kalle
Block user comment: 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:
------------------------------------------------------------------------
[2010-10-22 04:05:09] kalle@php.net
Automatic comment from SVN on behalf of kalle
Revision: http://svn.php.net/viewvc/?view=revision&revision=304600
Log: Fixed bug #53113 (number_format(): wrong usage of term
"character" in multi-byte context)
------------------------------------------------------------------------
[2010-10-20 13:41:28] alex dot schuch at gmx dot de
Description:
------------
"Only the first character of thousands_sep is used. For example, if you
use
& as thousands_sep on the number 1000, number_format() will return
1&000."
This example is based on US-ASCII or other one-byte character sets. If
for
example the *single character* "ü" in UTF-8 is used, the
byte-representation is
two byte (I might be wrong, but this is not relevant). The function
number_format() uses the *first byte* of that character, resulting in
something
broken, like broken UTF-8.
Expected result:
----------------
Add the following note:
Multi-byte characters are *not* supported in this function, as only the
first byte
will be used, resulting in broken encoding.
Furthermore:
Only "thousands_sep" has this notice as of now, but according to my
tests, the
same applies to "dec_point". So please add the note above there as well.
Actual result:
--------------
> php -r "var_dump(number_format(123456789.123, 4, 'ö',
> 'ä'));"
string(16) "123�456�789�1230"
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=53113&edit=1