Edit report at https://bugs.php.net/bug.php?id=54240&edit=1

 ID:                 54240
 Updated by:         patrickalla...@php.net
 Reported by:        phpbug at ymail dot com
 Summary:            mb_ereg_search_getpos() counts umlauts twice
-Status:             Open
+Status:             Not a bug
 Type:               Bug
 Package:            Regexps related
 PHP Version:        5.2.17
 Block user comment: N
 Private report:     N

 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

As mentioned in the documentation:
"The position is represented by bytes from the head of string."
and as such this is the expected behavior.


Previous Comments:
------------------------------------------------------------------------
[2011-03-13 08:33:55] phpbug at ymail dot com

Description:
------------
mb_ereg_search_getpos() seems to count German umlauts twice. See test script.

Test script:
---------------
mb_regex_encoding('UTF-8');

$test1 = "ab";
$test2 = "ääb";
$test3 = "äääb";

mb_ereg_search_init($test1, "b");
mb_ereg_search();
echo "Test1: " . mb_ereg_search_getpos(); // Result: 2

mb_ereg_search_init($test2, "b");
mb_ereg_search();
echo "Test2: " . mb_ereg_search_getpos(); // Result: 5 (should be "3")

mb_ereg_search_init($test3, "b");
mb_ereg_search();
echo "Test3: " . mb_ereg_search_getpos(); // Result: 7 (should be "4")



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



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

Reply via email to