#48574 [Asn]: Locale::lookup modifies matching tag

From: Date: Thu, 02 Jul 2009 00:10:13 +0000
Subject: #48574 [Asn]: Locale::lookup modifies matching tag
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-139103@lists.php.net to get a copy of this message
ID: 48574 Updated by: stas@php.net Reported By: a dot schilder at gmx dot de Status: Assigned Bug Type: I18N and L10N related Operating System: Windows XP PHP Version: 5.3.0RC3 Assigned To: stas New Comment: Docs are wrong, it should be: echo Locale::lookup($languages, 'en_US', false, 'en_UK'); But there's also a bug in lookup, will fix it. Previous Comments: ------------------------------------------------------------------------ [2009-06-24 06:41:12] a dot schilder at gmx dot de Email changed ------------------------------------------------------------------------ [2009-06-16 19:23:07] a dot schilder at gmx dot de Description: ------------ The documentation says that the return value of Locale::lookup is "The closest matching language tag or default value.", but the matching tag is modified. The result of the example below doesn't match the searched (en_US) nor the matched (en-us) tag, but is totally different (en_us). Reproduce code: --------------- <?php $languages = array("en", "en-us"); echo Locale::lookup($languages, 'en_US', 'en_UK'); ?> Expected result: ---------------- en-us Actual result: -------------- en_us ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=48574&edit=1

« previous php.bugs (#139103) next »