php.net |  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
 [2008-10-20 18:34 UTC] lokitek at gmail dot com
Description:
------------
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.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-10-20 20:46 UTC] jani@php.net
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: Sat Dec 21 12:01:31 2024 UTC