php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39999 mb_eregi_replace() and mb_ereg_replace() is not caseinsensitive for multibyte
Submitted: 2007-01-02 08:45 UTC Modified: 2007-01-11 16:05 UTC
Votes:2
Avg. Score:4.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:1 (50.0%)
From: zilvinas at speros dot lt Assigned:
Status: Not a bug Package: mbstring related
PHP Version: 5.2.0 OS: Debian 2.6.12-1-k7-smp
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: zilvinas at speros dot lt
New email:
PHP Version: OS:

 

 [2007-01-02 08:45 UTC] zilvinas at speros dot lt
Description:
------------
The function mb_eregi_replace() and/or function mb_ereg_replace() with 'i' option is not caseinsensitive for multibyte characters.

Reproduce code:
---------------
<?php
mb_regex_encoding('UTF-8');

$pattern = utf8_encode('?');
$replace = 'X';
$subject = utf8_encode('?BER ?ber');

$result = mb_eregi_replace($pattern, $replace, $subject);
//$result = mb_ereg_replace($pattern, $replace, $subject, 'i');

echo utf8_decode($result) . "\n";
?>

Expected result:
----------------
XBER Xber

Actual result:
--------------
?BER Xber


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-01-02 09:37 UTC] zilvinas at speros dot lt
A more simplistic example to reproduce the problem:


Reproduce code:
---------------

<?

mb_internal_encoding('UTF-8');
mb_regex_encoding('UTF-8');


$pattern = '?'; //s 'crown'
$replace = 'X';

$subject = '?iltas, ?iltas';

$result = mb_eregi_replace($pattern, $replace, $subject);

echo $result;
?>

Expected result: 
--------------
Xiltas, Xiltas


Actual result:
--------------
?iltas, Xiltas
 [2007-01-02 09:41 UTC] zilvinas at speros dot lt
changed category
 [2007-01-11 16:05 UTC] tony2001@php.net
ext/mbstring is a wrapper for Oniguruma library, which does the search and replace.
Therefore it's not PHP problem.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 16:01:28 2024 UTC