|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46346 Ereg_replace of x bug
Submitted: 2008-10-20 18:34 UTC Modified: 2008-10-20 20:46 UTC
From: lokitek at gmail dot com Assigned:
Status: Not a bug Package: *Unicode Issues
PHP Version: 5.2.6 OS: Red Hat Enterprise
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: lokitek at gmail dot com
New email:
PHP Version: OS:


 [2008-10-20 18:34 UTC] lokitek at gmail dot com
Trying to remove/convert any non-utf8 character to an html equivalent, x is being replaced when it shouldn't.

The ord value of x is 120. The ord value of Y diaeresis is suppose to be 376.

Reproduce code:
$string = "x";

echo $string;

$string = ereg_replace(376,"Ÿ",$string);

echo $string;

Expected result:
x should still be echo'd the second time.

Actual result:
Y diaeresis is being echo'd out.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-10-20 20:46 UTC]
ereg_* functions are not unicode aware. Use preg_* functions which 
are. No bug but lacking support (which will never be implemented).
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 22 08:01:33 2024 UTC