Bug #68414 [Opn->Wfx]: Yet another strtolower/upper problem in tr_TR
| From: | aharvey@php.net | Date: | Thu, 13 Nov 2014 19:35:02 +0000 |
| Subject: | Bug #68414 [Opn->Wfx]: Yet another strtolower/upper problem in tr_TR | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-188582@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=68414&edit=1
ID: 68414
Updated by: aharvey@php.net
Reported by: julien at palard dot fr
Summary: Yet another strtolower/upper problem in tr_TR
-Status: Open
+Status: Wont fix
Type: Bug
-Package: *Languages/Translation
+Package: mbstring related
Operating System: all
PHP Version: 5.5.18
Block user comment: N
Private report: N
New Comment:
Ultimately, mbstring just isn't locale aware â although there's a hack in the code
to handle ISO-8859-9 strings differently, I don't really think there's a sensible way to
handle this in the general case given the limitations of mbstring's API.
Previous Comments:
------------------------------------------------------------------------
[2014-11-13 14:02:08] julien at palard dot fr
Description:
------------
Lots of bugs have beed opened on this subject, lots of bugs have beed closed / resolved / etc : https://bugs.php.net/search.php?search_for=turkish&boolean=0&limit=30&order_by=&direction=DESC&cmd=display&status=All&bug_type=All&project=All&php_os=&phpver=&cve_id=&assign=&author_email=&bug_age=0&bug_updated=0
Those bugs typically address iso8859-9, the latin-5 character encoding used in Turkey, this one
addresses the UTF8 encoding:
In turkish:
SMALL I capitalized is CAPITAL I WITH DOT ABOVE (and vice-versa)
SMALL DOTLESS I capitalized CAPITAL I (and vice-versa)
In PHP I got (see test script)
Expects CAPITAL I WITH DOT ABOVE: iI
Expects SMALL I WITHOUT DOT: Ii
Which is, more or less, wrong for the 4 tests.
Test script:
---------------
<?php
mb_internal_encoding('UTF-8');
setlocale(LC_ALL, 'tr_TR.UTF-8');
echo "Expects CAPITAL I WITH DOT ABOVE: " . strtoupper('i') .
mb_strtoupper('i', 'UTF-8') . PHP_EOL;
echo "Expects SMALL I WITHOUT DOT: " . strtolower('I') .
mb_strtolower('I', 'UTF-8') . PHP_EOL;
Expected result:
----------------
Expects CAPITAL I WITH DOT ABOVE: İİ
Expects SMALL I WITHOUT DOT: ıı
Actual result:
--------------
Expects CAPITAL I WITH DOT ABOVE: iI
Expects SMALL I WITHOUT DOT: Ii
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=68414&edit=1