Bug #79986 [NEW]: str_ireplace bug with diacritics characters

From: Date: Mon, 17 Aug 2020 18:03:51 +0000
Subject: Bug #79986 [NEW]: str_ireplace bug with diacritics characters
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-228628@lists.php.net to get a copy of this message
From: cryptooman at yandex dot ru Operating system: Ubuntu 18.04 PHP version: 7.2.33 Package: *General Issues Bug Type: Bug Bug description:str_ireplace bug with diacritics characters Description: ------------ --- From manual page: https://php.net/function.str-ireplace --- Function str_ireplace fails to replace diacritics characters if case (lower or upper) of search pattern does not match case of characters in subject string. Affected languages: french, russian, german, spanish, etc. Short php-script sample provided below. Test script: --------------- <?php // French // Result: 1À 2 3Ä 4Æ // Expect: 11 22 33 44 echo str_ireplace(['à', 'â', 'ä', 'æ'], ['1', '2', '3', '4'], 'àÀ â äÄ æÆ') . PHP_EOL; // Result: à1 â2 ä3 æ4 // Expect: 11 22 33 44 echo str_ireplace(['À', 'Â', 'Ä', 'Æ'], ['1', '2', '3', '4'], 'àÀ â äÄ æÆ') . PHP_EOL; // Russian // Result: 1Ё 2Й // Expect: 11 22 echo str_ireplace(['ё', 'й'], ['1', '2'], 'ёЁ йЙ') . PHP_EOL; // Result: ё1 й2 // Expect: 11 22 echo str_ireplace(['Ё', 'Й'], ['1', '2'], 'ёЁ йЙ') . PHP_EOL; -- Edit bug report at https://bugs.php.net/bug.php?id=79986&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=79986&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=79986&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=79986&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=79986&r=needscript Try newer version: https://bugs.php.net/fix.php?id=79986&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=79986&r=support Expected behavior: https://bugs.php.net/fix.php?id=79986&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=79986&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=79986&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=79986&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=79986&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=79986&r=dst IIS Stability: https://bugs.php.net/fix.php?id=79986&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=79986&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=79986&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=79986&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=79986&r=mysqlcfg

« previous php.bugs (#228628) next »