|  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
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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: devilio at gmail dot com
New email:
PHP Version: OS:


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

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

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-09-12 14:12 UTC]
Assigned to maintainer.
 [2005-11-13 21:09 UTC]
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-2019 The PHP Group
All rights reserved.
Last updated: Sat Oct 19 08:01:28 2019 UTC