Bug #54240 [Opn->Nab]: mb_ereg_search_getpos() counts umlauts twice
| From: | patrickallaert@php.net | Date: | Wed, 20 Jun 2012 23:16:51 +0000 |
| Subject: | Bug #54240 [Opn->Nab]: mb_ereg_search_getpos() counts umlauts twice | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-171400@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=54240&edit=1
ID: 54240
Updated by: patrickallaert@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