Can str_replace be safely used on a UTF-8 encoded string if it's only given valid UTF-8 encoded stri

Posted by Manos Dilaverakis on Stack Overflow See other posts from Stack Overflow or by Manos Dilaverakis
Published on 2010-04-16T10:33:23Z Indexed on 2010/04/21 22:33 UTC
Read the original article Hit count: 154

Filed under:
|

PHP's str_replace() was intended only for ANSI strings and as such can mangle UTF-8 strings. However, given that it's binary-safe would it work properly if it was only given valid UTF-8 strings as arguments?

Edit: I'm not looking for a replacement function, I would just like to know if this hypothesis is correct.

© Stack Overflow or respective owner

Related posts about utf-8

Related posts about php