php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48574 Locale::lookup modifies matching tag
Submitted: 2009-06-16 19:23 UTC Modified: 2009-07-02 00:44 UTC
From: a dot schilder at gmx dot de Assigned: stas (profile)
Status: Closed Package: I18N and L10N related
PHP Version: 5.3.0RC3 OS: Windows XP
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: a dot schilder at gmx dot de
New email:
PHP Version: OS:

 

 [2009-06-16 19:23 UTC] 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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-06-24 06:41 UTC] a dot schilder at gmx dot de
Email changed
 [2009-07-02 00:10 UTC] stas@php.net
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.
 [2009-07-02 00:44 UTC] stas@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 11:01:30 2024 UTC