Bug #76202 [Opn->Nab]: \NumberFormatter::getSymbol() returns wrong international currency symbol

From: Date: Mon, 09 Apr 2018 15:07:21 +0000
Subject: Bug #76202 [Opn->Nab]: \NumberFormatter::getSymbol() returns wrong international currency symbol
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-214667@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=76202&edit=1 ID: 76202 Updated by: requinix@php.net Reported by: a dot schilder at gmx dot de Summary: \NumberFormatter::getSymbol() returns wrong international currency symbol -Status: Open +Status: Not a bug Type: Bug Package: I18N and L10N related Operating System: Windows 10 PHP Version: 7.2.4 Block user comment: N Private report: N New Comment: PHP's intl functionality comes from the ICU project. http://site.icu-project.org/ Their information comes from the CLDR project. http://cldr.unicode.org/index The currency change to MRU is included in the most recent CLDR 33: http://cldr.unicode.org/index/downloads/cldr-33 > Addition of new currency code MRU for Mauritania; replaces MRO. That is included in ICU 61: http://site.icu-project.org/download/61 > ICU 61 upgrades to CLDR 33 locale data, and they also mention > New currency code MRU for Mauritania. So you have to check your system's copy of libicu or whatever it's called and see where you're at. Given it was released only a couple weeks ago, if you want to run the latest and greatest rules then you'll probably need to build yourself a copy of libicu from the ICU4C source. With that copy built and installed on your system correctly, PHP and intl should show you "MRU". As for the docs, the intro page does talk about ICU and includes a couple links. Is there something else you'd like to see there? Previous Comments: ------------------------------------------------------------------------ [2018-04-09 14:46:45] a dot schilder at gmx dot de 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 this bug report at https://bugs.php.net/bug.php?id=76202&edit=1

« previous php.bugs (#214667) next »