#35520 [Opn->WFx]: Functioncs substr, str_replace, strtr and other do not work with UTF-8 string

From: Date: Fri, 02 Dec 2005 11:24:53 +0000
Subject: #35520 [Opn->WFx]: Functioncs substr, str_replace, strtr and other do not work with UTF-8 string
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-89636@lists.php.net to get a copy of this message
ID: 35520 Updated by: tony2001@php.net Reported By: kotysek at email dot cz -Status: Open +Status: Wont fix -Bug Type: *Languages/Translation +Bug Type: Strings related Operating System: Windows XP PHP Version: 4.4.1 New Comment: This is the main reason for PHP6 to appear. So you have to wait for it. Previous Comments: ------------------------------------------------------------------------ [2005-12-02 12:18:56] kotysek at email dot cz Description: ------------ If I try to use almost any string function on a string with non-ascii characters encoded in UTF-8 I get some messed up results. This relates mainly to: substr, str_replace, strtr, strtolower, strtoupper, strlen, ... My string: consists of czech, slovak, german, etc. chars like è (č) , ň (ň) ä (ä) , ö (ö) ,... I can't even use the most basic thing like below. Reproduce code: --------------- $string = "aaè"; // last character is special czech "c" (č) echo $string[2]; Expected result: ---------------- // the code should just print "è" (č) è Actual result: -------------- // it prints some character (depends on the character following "è" Ò ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=35520&edit=1

« previous php.bugs (#89636) next »