ID: 42290
Updated by: hirokawa@php.net
Reported By: arysin at gmail dot com
Status: Assigned
Bug Type: mbstring related
Operating System: *
PHP Version: 5.2CVS-2007-08-14
Assigned To: hirokawa
New Comment:
arysin,
What kind of encoding you are using ?
For UTF-8 and ISO-8859-1, 0x8a is assigned to Line Tab.
c.f.: http://en.wikipedia.org/wiki/ISO_8859-1
http://en.wikipedia.org/wiki/UTF-8
In my understanding, 0x8a shouldn't be interpreted as
upper letter of 0x9a for ISO-8859-1/UTF-8.
If you are using CP1252 (Windows-1252), it is understandable,
but, CP1252 is not supported yet in the Oniguruma library
(multibyte regex engine of mbstring).
http://en.wikipedia.org/wiki/Windows-1252
Previous Comments:
------------------------------------------------------------------------
[2007-08-19 20:05:04] jani@php.net
I'm using the bundled PCRE library. I don't remember what the version
is.
------------------------------------------------------------------------
[2007-08-19 02:27:06] hirokawa@php.net
I got the same result as arysin,
(PHP_5_2CVS 20070819, PCRE 7.2 2007-06-19)
iltas, Xiltas
iltas, Xiltas
I think PCRE is also not working.
Jani, which version of PHP/PCRE you are using ?
------------------------------------------------------------------------
[2007-08-17 13:46:13] jani@php.net
Assigned to the maintainer of mbstring extension.
------------------------------------------------------------------------
[2007-08-14 09:11:37] jani@php.net
I get this as output:
iltas, Xiltas
Xiltas, Xiltas
So I don't think there's anything wrong with PCRE, just mbstring stuff.
------------------------------------------------------------------------
[2007-08-14 01:28:44] arysin at gmail dot com
Description:
------------
The function mb_eregi_replace() and/or function mb_ereg_replace() with
'i' option is not caseinsensitive for multibyte characters.
The same problem occurs for preg_replace() with /i option.
This bug was reported before twice:
1) (#39999) and was marked as Bogus stating it's not php bug.
2) (#25953) was marked as Won't fix with note "Probably the issue will
be resolved in php5."
As one cannot add anything to closed bug I'd like to reopen this bug
here for the reason stated below:
This library is not linked dynamically, on contrary its source is
present in php source repository. So there's no way for php users to
have this problem fixed without php itself being fixed.
More than that, the version of oniguruma in php repository is pretty
old so at least importing the newer version of it would be a nice try to
fix this bug.
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;
$result = preg_replace("/$pattern/iu", $replace, $subject);
echo $result . "\n";
?>
Expected result:
----------------
Xiltas, Xiltas
Xiltas, Xiltas
Actual result:
--------------
iltas, Xiltas
iltas, Xiltas
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=42290&edit=1