php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76001 locale_accept_from_http normalizes both zh_TW and zh_CN to zh
Submitted: 2018-02-23 20:12 UTC Modified: 2021-06-15 10:06 UTC
Votes:4
Avg. Score:4.8 ± 0.4
Reproduced:4 of 4 (100.0%)
Same Version:4 (100.0%)
Same OS:2 (50.0%)
From: mollasadra at gmail dot com Assigned: cmb (profile)
Status: Not a bug Package: intl (PECL)
PHP Version: 7.1.14 OS:
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: mollasadra at gmail dot com
New email:
PHP Version: OS:

 

 [2018-02-23 20:12 UTC] mollasadra at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/locale.acceptfromhttp
---

php > echo locale_accept_from_http("zh_TW");
zh
php > echo locale_accept_from_http("zh_CN");
zh

Test script:
---------------
php > echo locale_accept_from_http("zh_TW");
zh
php > echo locale_accept_from_http("zh_CN");
zh


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-09-01 10:50 UTC] cmb@php.net
-Status: Open +Status: Verified -Package: *Languages/Translation +Package: intl
 [2019-09-01 10:50 UTC] cmb@php.net
Confirmed: <https://3v4l.org/e7HJ4>.
 [2021-06-15 10:06 UTC] cmb@php.net
-Status: Verified +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2021-06-15 10:06 UTC] cmb@php.net
Actually, this is not a bug.  The default ICU data neither
recognize zh_TW nor zh_CN, so report zh as fallback.  Using the
proper zh_Hant and zh_Hans gives the desired results.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 11:01:34 2025 UTC