Bug #76202 [NEW]: \NumberFormatter::getSymbol() returns wrong international currency symbol

From: Date: Mon, 09 Apr 2018 14:46:48 +0000
Subject: Bug #76202 [NEW]: \NumberFormatter::getSymbol() returns wrong international currency symbol
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-214666@lists.php.net to get a copy of this message
From: a dot schilder at gmx dot de Operating system: Windows 10 PHP version: 7.2.4 Package: I18N and L10N related Bug Type: Bug Bug description:\NumberFormatter::getSymbol() returns wrong international currency symbol Description: ------------ In my tests I recognized that the currency code for Mauritania returned by \NumberFormatter::getSymbol() is 'MRO', although it was changed to 'MRU' from Janauary 1st 2018 (see: https://www.currency-iso.org/dam/isocy/downloads/dl_currency_iso_amendment_165.pdf). If you look into the Unicode CLDR, the code there is still set to 'MRO', so the question for me is: What is used as the base for the 'international currency symbol'? When it's ISO 4217 (as I'd expect), the code returned is wrong and should be corrected. If it's based on the Unicode CLDR data, the code is (currently) correct - but unexpected. In any case the used base for the currency symbol should be documented - so feel free to change this to a documentation bug if the Unicode data are used. Test script: --------------- <?php $formatter = new \NumberFormatter('*_MR', \NumberFormatter::CURRENCY); $currency = $formatter->getSymbol(\NumberFormatter::INTL_CURRENCY_SYMBOL); echo $currency; Expected result: ---------------- MRU Actual result: -------------- MRO -- Edit bug report at https://bugs.php.net/bug.php?id=76202&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=76202&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=76202&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=76202&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=76202&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=76202&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=76202&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=76202&r=needscript Try newer version: https://bugs.php.net/fix.php?id=76202&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=76202&r=support Expected behavior: https://bugs.php.net/fix.php?id=76202&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=76202&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=76202&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=76202&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=76202&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=76202&r=dst IIS Stability: https://bugs.php.net/fix.php?id=76202&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=76202&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=76202&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=76202&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=76202&r=mysqlcfg

« previous php.bugs (#214666) next »