php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34479 mb_strpos returns bad results with UTF-8 strings
Submitted: 2005-09-12 14:04 UTC Modified: 2005-11-21 01:00 UTC
Votes:6
Avg. Score:4.3 ± 0.7
Reproduced:6 of 6 (100.0%)
Same Version:2 (33.3%)
Same OS:1 (16.7%)
From: devilio at gmail dot com Assigned: moriyoshi (profile)
Status: No Feedback Package: mbstring related
PHP Version: 4.4.0 OS: Debian Sarge
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: devilio at gmail dot com
New email:
PHP Version: OS:

 

 [2005-09-12 14:04 UTC] devilio at gmail dot com
Description:
------------
mb_strpos returns wrong value with some UTF-8 strings

Reproduce code:
---------------
echo(mb_strpos('??hello', 'hello', 0, 'UTF-8'));

Expected result:
----------------
2

Actual result:
--------------
0

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-09-12 14:12 UTC] sniper@php.net
Assigned to maintainer.
 [2005-11-13 21:09 UTC] moriyoshi@php.net
Seems like the octets in your example that is supposed to represent a UTF-8 character is not a valid UTF-8 sequence.

Could you please provide the exact string that you fed to mb_strpos() ?

 [2005-11-21 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jan 15 15:01:31 2025 UTC