Bug #75225 [Com]: str_ireplace() has no case insensitivity on non-latin letters in UTF strings

From: Date: Mon, 18 Sep 2017 14:27:15 +0000
Subject: Bug #75225 [Com]: str_ireplace() has no case insensitivity on non-latin letters in UTF strings
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-211216@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75225&edit=1 ID: 75225 Comment by: 1234ru at gmail dot com Reported by: 1234ru at gmail dot com Summary: str_ireplace() has no case insensitivity on non-latin letters in UTF strings Status: Open Type: Bug Package: *Languages/Translation PHP Version: 7.1.9 Block user comment: N Private report: N New Comment: An actual example is this: echo str_ireplace("Б", "1", "БББббб"); // yelds 111ббб instead of 111111 (It doesn't allow me to edit the bug description so I post it as a comment.) Previous Comments: ------------------------------------------------------------------------ [2017-09-18 14:20:25] 1234ru at gmail dot com Description: ------------ In other words, it simply ignores case-insensitive replacement when dealing with any letters except Latin. Not a single word in the documentation at http://php.net/str_ireplace covers the issue. And there is no corresponding mb* function. Test script: --------------- echo str_ireplace("б", "1", "111ббб"); // russian letters in UTF-8 encoding Expected result: ---------------- 111111 Actual result: -------------- 111ббб ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=75225&edit=1

« previous php.bugs (#211216) next »