Req #70072 [Opn]: Add a language avare uppercase/lowercase solution without need of locale change
Edit report at https://bugs.php.net/bug.php?id=70072&edit=1
ID: 70072
Updated by: nikic@php.net
Reported by: ongun dot kanat at gmail dot com
Summary: Add a language avare uppercase/lowercase solution
without need of locale change
Status: Open
Type: Feature/Change Request
Package: mbstring related
Operating System: any
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2015-07-14 13:14:07] ongun dot kanat at gmail dot com
Description:
------------
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.
http://unicode.org/faq/casemap_charprop.html#1
Test script:
---------------
<?php
mb_internal_encoding("UTF-8");
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
maÃ
İLAà // Turkish I issue
ıÅık
Actual result:
--------------
MAÃ
maÃ
ILAÃ
iÅik
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=70072&edit=1
Thread (2 messages)