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
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.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 21:01:30 2024 UTC