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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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: Tue Mar 19 08:01:29 2024 UTC