#31609 [Fbk->Opn]: str_word_count corrupts string with extended charset
| From: | jfo123 at hotmail dot com | Date: | Sat, 22 Jan 2005 06:53:18 +0000 |
| Subject: | #31609 [Fbk->Opn]: str_word_count corrupts string with extended charset | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-72650@lists.php.net to get a copy of this message | ||
ID: 31609
User updated by: jfo123 at hotmail dot com
Reported By: jfo123 at hotmail dot com
-Status: Feedback
+Status: Open
Bug Type: Scripting Engine problem
Operating System: RH 9.0
-PHP Version: 4.3.8
+PHP Version: 4.3.4
New Comment:
Take away the last } nothing else.
Parsable 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;
Previous Comments:
------------------------------------------------------------------------
[2005-01-19 12:42:44] derick@php.net
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.
------------------------------------------------------------------------
[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