|  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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
39 - 30 = ?
Subscribe to this entry?

 [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-2020 The PHP Group
All rights reserved.
Last updated: Sat May 30 15:01:24 2020 UTC