Doc #53113 [Csd]: number_format(): wrong usage of term "character" in multi-byte context

From: Date: Wed, 27 Oct 2010 14:16:15 +0000
Subject: Doc #53113 [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-5433@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 User updated by: alex dot schuch at gmx dot de Reported by: alex dot schuch at gmx dot de Summary: number_format(): wrong usage of term "character" in multi-byte context Status: Closed Type: Documentation Problem Package: Documentation problem Operating System: - PHP Version: Irrelevant Assigned To: kalle Block user comment: N New Comment: The comment was only added for thousands_sep. According to current version of PHP 5.3 branch, the same "issue" applies to "dec_point" as well. Please add the note to that parameter as well. Thanks. Previous Comments: ------------------------------------------------------------------------ [2010-10-22 04:05:14] kalle@php.net 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. ------------------------------------------------------------------------ [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

« previous php.doc.bugs (#5433) next »