ID:               43567
 User updated by:  brito_victor at yahoo dot fr
 Reported By:      brito_victor at yahoo dot fr
 Status:           Open
 Bug Type:         PCRE related
 Operating System: Windows XP SP2
 PHP Version:      5.2.5
 New Comment:

I think it is a bug because, when the script is tested within version
5.2.4, it returns true.


Previous Comments:
------------------------------------------------------------------------

[2007-12-13 12:48:17] confins_de_l_univers at yahoo dot fr

I've got the same error on linux (Debian Etch).

But your pattern (and your subject) is not a valid utf-8 string.
I've checked that with : mb_check_encoding("\xf8\xa1\xa1\xa1\xa1",
'UTF-8')
and it returns false.

So, I think it's not a bug.

------------------------------------------------------------------------

[2007-12-11 17:08:55] brito_victor at yahoo dot fr

Bug seen on Windows XP SP2.

------------------------------------------------------------------------

[2007-12-11 17:02:04] brito_victor at yahoo dot fr

Description:
------------
In a test script, I call preg_match() function, using the flag u, in
order to test an UTF-8 regular expression with hexadecimal characters.
Of course, the mbstring extension is loaded and active.

Reproduce code:
---------------
$mb = function_exists('mb_detect_encoding');
$pregutf8 = preg_match("/\xf8\xa1\xa1\xa1\xa1/u",
"\xf8\xa1\xa1\xa1\xa1");

Expected result:
----------------
Returns true for both variables.

Actual result:
--------------
Returns true for $mb.
Returns the following warning message for $pregutf8: "Warning: 
preg_match() [function.preg-match]: Compilation failed: invalid UTF-8
string at offset 0"


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=43567&edit=1

Reply via email to