php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50885 srt_replace() function don't work.
Submitted: 2010-01-30 11:18 UTC Modified: 2010-01-30 15:41 UTC
From: tenz699 at hotmail dot com Assigned:
Status: Not a bug Package: Strings related
PHP Version: 5.2.12 OS: FreeBSD 6.4-RELEASE-p8
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: tenz699 at hotmail dot com
New email:
PHP Version: OS:

 

 [2010-01-30 11:18 UTC] tenz699 at hotmail dot com
Description:
------------
echo str_ireplace('་','-', 'ས་སི་ང་');

or

echo str_ireplace('x',' ་', 'x - x');


don't work on php 5.2.12, it used to work without any problem on php 5.2.6


Reproduce code:
---------------
<?php
echo str_ireplace('&#3851;','-', '&#3942;&#3851;&#3942;&#3954;&#3851;&#3908;&#3851;');
echo "\n<br>";
echo str_ireplace('x',' &#3851;', 'x - x');
?>

Expected result:
----------------
&#3942;-&#3942;&#3954;-&#3908;-
 &#3851; -  &#3851;

Actual result:
--------------
-------
 ? - ?

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-01-30 11:27 UTC] jani@php.net
Is this really what you tried? Since that works just fine. Or did your script originally contain some unicode chars or something like that? In latter case it might be good if you provided the script downloadable somewhere..
 [2010-01-30 15:41 UTC] jani@php.net
User reply: "It was't a bug, but an encoding issue. But was surprise to find 2 php versions handled differently. The problem is solved when i save the file a utf-8 without BOM."

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 18:01:30 2024 UTC