|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
[2021-06-11 17:16 UTC] cmb@php.net
-Status: Open
+Status: Verified
[2021-06-11 17:16 UTC] cmb@php.net
[2021-06-11 17:23 UTC] cmb@php.net
-Assigned To:
+Assigned To: cmb
[2021-06-14 13:03 UTC] cmb@php.net
[2021-06-16 08:39 UTC] git@php.net
-Status: Verified
+Status: Closed
[2021-06-16 08:39 UTC] git@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 15:00:01 2025 UTC |
Description: ------------ When I call Locale::lookup as follows, I get the expected result 'en-US': Locale::lookup(['en', 'en-US'], 'en-US-u-cu-EUR-tz-deber-fw-mon', false); I should get the same result when using the canonicalize option, because following the docs all "arguments will be converted to canonical form before matching" and after conversion, they should still match - but I get 'en' instead of the expected locale 'en-US': Locale::lookup(['en', 'en-US'], 'en-US-u-cu-EUR-tz-deber-fw-mon', true); I also get 'en' when using the canonicalized versions directly (no matter if the canonicalize option is set or not): echo Locale::lookup(['en', 'en_US'], 'en_US@currency=eur;fw=mon;timezone=Europe/Berlin', false) . PHP_EOL; echo Locale::lookup(['en', 'en_US'], 'en_US@currency=eur;fw=mon;timezone=Europe/Berlin', true) . PHP_EOL; Test script: --------------- <?php echo Locale::lookup(['en', 'en-US'], 'en-US-u-cu-EUR-tz-deber-fw-mon', false) . PHP_EOL; echo PHP_EOL; echo Locale::canonicalize('en-US-u-cu-EUR-tz-deber-fw-mon') . PHP_EOL; echo Locale::canonicalize('en-US') . PHP_EOL; echo Locale::canonicalize('en') . PHP_EOL; echo PHP_EOL; echo Locale::lookup(['en', 'en-US'], 'en-US-u-cu-EUR-tz-deber-fw-mon', true) . PHP_EOL; echo Locale::lookup(['en', 'en_US'], 'en_US@currency=eur;fw=mon;timezone=Europe/Berlin', false) . PHP_EOL; echo Locale::lookup(['en', 'en_US'], 'en_US@currency=eur;fw=mon;timezone=Europe/Berlin', true) . PHP_EOL; Expected result: ---------------- en-US en_US@currency=eur;fw=mon;timezone=Europe/Berlin en_US en en-US en_US en_US Actual result: -------------- en-US en_US@currency=eur;fw=mon;timezone=Europe/Berlin en_US en en en en