php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63388 Locale::getDisplayRegion returns wrong results
Submitted: 2012-10-29 21:31 UTC Modified: 2016-04-11 13:10 UTC
Votes:3
Avg. Score:5.0 ± 0.0
Reproduced:3 of 3 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: marcosdsanchez at gmail dot com Assigned:
Status: Not a bug Package: intl (PECL)
PHP Version: 5.3.18 OS: mac os x 10.8.2
Private report: No CVE-ID: None
 [2012-10-29 21:31 UTC] marcosdsanchez at gmail dot com
Description:
------------
Locale::getDisplayRegion does not return localized country names for some 
countries.

Example:

  echo Locale::getDisplayRegion('en_KY', 'hy_AM');

Returns:
  KY

It should return instead the localized name of "Cayman Islands".

 

Test script:
---------------
https://gist.github.com/9b64706870f9c3b29d75

Expected result:
----------------
I expect the method to return an appropriately localized display name for the 
regions of the hy_AM locale. It returns the country code instead.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-04-11 13:10 UTC] ab@php.net
-Status: Open +Status: Not a bug
 [2016-04-11 13:10 UTC] ab@php.net
Thanks for the report, better late than never too look into it.

With todays PHP-7.0 and ICU 57.1 i don't reproduce this behavior. Fe

php.exe -r "echo Locale::getDisplayRegion('de-ch');"
Switzerland
php.exe -r "echo Locale::getDisplayRegion('de-de');"
Germany

Unfortunately no ICU version is given in the ticket, but most likely it is something not PHP related. Every version of ICU improves the data set, so that was most likely the issue.

Thanks.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Tue Jan 28 19:01:26 2020 UTC