From:             david at santinoli dot com
Operating system: Linux
PHP version:      4.3.1
PHP Bug Type:     mbstring related
Bug description:  Overloaded strrpos() gives wrong results

With

 php_value mbstring.internal_encoding "UTF-8"
 php_value mbstring.func_overload 6

in my php.ini, the overloaded strrpos() gives a wrong result when parsing
an UTF-8 string.
For example,

 $s=iconv("ISO-8859-1","UTF-8","é.jpg");
 $x=strrpos($s,".");

assigns the value 2 to $x, instead of the correct one (1).

My PHP was configured with
./configure  --with-config-file-path=/etc/httpd/conf --with-apxs
--with-pgsql 
--with-iconv --enable-mbstring --enable-mbregex

A patch which fixes this bug can be found at
http://village.flashnet.it/users/mi1802/php-4.3.1-mbstring.diff

Cheers,
 David
-- 
Edit bug report at http://bugs.php.net/?id=22330&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=22330&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=22330&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=22330&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=22330&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=22330&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=22330&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=22330&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=22330&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=22330&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=22330&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22330&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=22330&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=22330&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=22330&r=gnused

Reply via email to