#31609 [Opn->Bgs]: str_word_count corrupts string with extended charset
| From: | sniper@php.net | Date: | Sat, 22 Jan 2005 13:13:20 +0000 |
| Subject: | #31609 [Opn->Bgs]: str_word_count corrupts string with extended charset | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-72660@lists.php.net to get a copy of this message | ||
ID: 31609
Updated by: sniper@php.net
Reported By: jfo123 at hotmail dot com
-Status: Open
+Status: Bogus
Bug Type: Scripting Engine problem
Operating System: RH 9.0
PHP Version: 4.3.4
New Comment:
1) your PHP version is too old.
2) works fine with latest CVS.
Previous Comments:
------------------------------------------------------------------------
[2005-01-22 07:53:17] jfo123 at hotmail dot com
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;
------------------------------------------------------------------------
[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