ID:               38860
 Updated by:       [EMAIL PROTECTED]
 Reported By:      me at andr dot biz
-Status:           Open
+Status:           Feedback
 Bug Type:         PCRE related
 Operating System: freebsd 6.1
 PHP Version:      4.4.4
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip




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

[2006-09-17 14:29:47] me at andr dot biz

Description:
------------
/*Guys! Your bugtracking software hase problems with cyrillic symbols.
I encoded all my words in example into HTML-entities. Please decode
them to UTF-8 before reproducing */

It processes UTF-8 strings incorrectly.

Firstly, please see the article:http://www.phpwact.org/php/i18n/utf-8
This article has so many described PHP bugst related to UTF-8. I think
that ALL theese bugs must be fixed ASAP.

Reproduce code:
---------------
<pre>
<?php

if (!setlocale(LC_ALL,"ru_RU.UTF-8")) die('error');

$textUtf8 = "&#1087;&#1088;&#1080;&#1074;&#1077;&#1090;
&#1072;&#1085;&#1076;&#1088;&#1077;&#1081;";
preg_match('/&#1072;&#1085;&#1076;&#1088;&#1077;&#1081;/u', $textUtf8,
$matches, PREG_OFFSET_CAPTURE);

print_r($matches);

?>
</pre>

Expected result:
----------------
Array
(
    [0] => Array
        (
            [0] => &#1072;&#1085;&#1076;&#1088;&#1077;&#1081;
            [1] => 7
        )

)

Actual result:
--------------
Array
(
    [0] => Array
        (
            [0] => &#1072;&#1085;&#1076;&#1088;&#1077;&#1081;
            [1] => 13
        )

)


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


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

Reply via email to