Bug #75225 [Com]: str_ireplace() has no case insensitivity on non-latin letters in UTF strings
| From: | spam2 at rhsoft dot net | Date: | Mon, 18 Sep 2017 14:28:24 +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-211217@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: spam2 at rhsoft dot net
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:
this is NOT a bug - most of the string funtion don't work for UTF8 at all and be warned about
making decisions about strlen() on UTF8 strings
http://php.net/manual/en/book.mbstring.php
Previous Comments:
------------------------------------------------------------------------
[2017-09-18 14:27:12] 1234ru at gmail dot com
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.)
------------------------------------------------------------------------
[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