|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #70072 Add a language avare uppercase/lowercase solution without need of locale change
Submitted: 2015-07-14 13:14 UTC Modified: 2017-07-28 10:47 UTC
Avg. Score:4.4 ± 0.9
Reproduced:7 of 8 (87.5%)
Same Version:2 (28.6%)
Same OS:2 (28.6%)
From: ongun dot kanat at gmail dot com Assigned:
Status: Open Package: mbstring related
PHP Version: Irrelevant OS: any
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.
Block user comment
Status: Assign to:
Bug Type:
From: ongun dot kanat at gmail dot com
New email:
PHP Version: OS:


 [2015-07-14 13:14 UTC] ongun dot kanat at gmail dot com
Using many languages in one page(at the same time) is possible when your clients work globally/multilingual. And sometimes developers like me are struggling in implement a page uses/modifies strings from many languages at the same time. And sometimes it's just meaningless to change locale of whole page for just one string. It would be awesome a parameter to change language in mbstring upper/lowercase operations.

Example case
I am displaying a page in English but also displaying strings in languages below:
ß -> SS in German, ı->I in Turkish

Unicode already has mappings for chars and special cases.

Test script:
echo mb_strtoupper("Maß\n");  // "MAß"
echo mb_strtolower("MAẞ\n");  // "maß"

echo mb_strtoupper("ilaç\n"); // "ILAÇ"
echo mb_strtolower("IŞIK\n"); // "iŞik"

Expected result:
MASS // Eszett
İLAÇ // Turkish I issue

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-07-28 10:47 UTC]
In master the first two cases will now work correctly. The latter two do not, as these are language-specific conditional special case mappings, which are currently not implemented.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 12 22:01:29 2024 UTC