#31609 [Opn->Fbk]: str_word_count corrupts string with extended charset
| From: | derick@php.net | Date: | Wed, 19 Jan 2005 11:42:45 +0000 |
| Subject: | #31609 [Opn->Fbk]: str_word_count corrupts string with extended charset | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-72455@lists.php.net to get a copy of this message | ||
ID: 31609
Updated by: derick@php.net
Reported By: jfo123 at hotmail dot com
-Status: Open
+Status: Feedback
Bug Type: Scripting Engine problem
Operating System: RH 9.0
PHP Version: 4.3.8
New Comment:
Your code doesn't even parse, please provide a working script Put it in
a zip/tgz file on a website if possible, and provide a link.
Previous Comments:
------------------------------------------------------------------------
[2005-01-19 12:35:23] jfo123 at hotmail dot com
Description:
------------
str_word_count corrupts string with extended charset as in the swedish
character set. Special chars are deleted from the string.
Reproduce code:
---------------
$title0 = "Världen är ångestfylld för katastrof";
$num_words = str_word_count($title0, 2);
foreach ($num_words AS $pos => $word) {
if ($pos < 50)
$title .= " $word";
}
print $title;
}
Expected result:
----------------
Världen är ångestfylld för katastrof
Actual result:
--------------
Vrlden r ngestfylld fr katastrof
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=31609&edit=1