php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79048 Turkish Capital [İ] Error in mb_strtolower();
Submitted: 2019-12-31 09:19 UTC Modified: 2021-06-30 18:09 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: root at baransel dot dev Assigned: cmb (profile)
Status: Not a bug Package: mbstring related
PHP Version: 7.4.1 OS: MacOS 10.15.2
Private report: No CVE-ID: None
 [2019-12-31 09:19 UTC] root at baransel dot dev
Description:
------------
---
From manual page: https://php.net/security.hiding
---

as 3v4l.org shows Output for 7.2.0 - 7.2.26 works like expected but Output for 7.3.0 - 7.4.1 does not.


mb_strtolower(), cannot undercase the letter [İ], please have a look at the example.

Test script:
---------------
<?php 
$program['bolum'] = '3. Sİezon 7. Bölüm';

if(strpos(mb_strtolower($program['bolum']), 'siezon')){
    var_dump('Baransel');
}


https://3v4l.org/qLP4q

Expected result:
----------------
I want the function to return me the undercase for letter [İ]

Actual result:
--------------
This is the result i'm getting => si̇ezon

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-12-31 09:36 UTC] root at baransel dot dev
Description:
------------

as 3v4l.org shows Output for 7.2.0 - 7.2.26 works like expected but Output for 7.3.0 - 7.4.1 does not.


mb_strtolower(), cannot undercase the letter İ, please have a look at the example.

Test script:
---------------
<?php 
$program['bolum'] = '3. Sİezon 7. Bölüm';

var_dump(mb_strtolower($program['bolum']));

if(strpos(mb_strtolower($program['bolum']), 'siezon')){
    var_dump('Baransel');
}


https://3v4l.org/b6C08

Expected result:
----------------
I want the function to return me the undercase for letter İ

e.g. 3. siezon 7. bölüm


Actual result:
--------------
This is what it outputs 3. si̇ezon 7. bölüm
 [2019-12-31 09:56 UTC] cmb@php.net
-Status: Open +Status: Not a bug -Package: *Unicode Issues +Package: mbstring related -Assigned To: +Assigned To: cmb
 [2019-12-31 09:56 UTC] cmb@php.net
Your assumption that İ would not be lowercased is wrong[1].  It
is, however, not lowercased as LATIN SMALL LETTER I, but rather as
LATIN SMALL LETTER I and COMBINING DOT ABOVE which is correct.

[1] <https://3v4l.org/BGP68>
 [2019-12-31 10:08 UTC] root at baransel dot dev
Can you please explain me why it works with PHP 7.2.0 - 7.2.26 and not with 7.3.0 - 7.4.1? They both output something different.
 [2019-12-31 18:44 UTC] requinix@php.net
> Can you please explain me why it works with PHP 7.2.0 - 7.2.26 and not with 7.3.0 - 7.4.1?
Because your understanding of how uppercasing and lowercasing of the Turkish i/I works has not stayed up to date with the latest Unicode rules. Ask Google for more information.
 [2021-06-30 15:26 UTC] qdinar at gmail dot com
i googled about this. "turkish i COMBINING DOT ABOVE" (without quotes) gave not proper result in first page. when i tried "turkish i COMBINING DOT ABOVE case folding" there is https://bugs.python.org/issue34723 as 2nd result. and it gives link to https://unicode.org/Public/UNIDATA/SpecialCasing.txt .
 [2021-06-30 18:03 UTC] qdinar at gmail dot com
unimportant edition to my words: i said "gave not proper result". i should say "gave not result i wanted".
 [2021-06-30 18:09 UTC] nikic@php.net
You can use mb_convert_case with MB_CASE_LOWER_SIMPLE to disable adherence to SpecialCasing.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 14:01:28 2024 UTC