Bug #63663 [NEW]: str_word_count does not properly handle non-latin characters

From: Date: Sat, 01 Dec 2012 02:29:17 +0000
Subject: Bug #63663 [NEW]: str_word_count does not properly handle non-latin characters
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-175054@lists.php.net to get a copy of this message
From: kobrien at kiva dot org Operating system: Ubuntu 12.04 PHP version: 5.3.20-dev Package: Strings related Bug Type: Bug Bug description:str_word_count does not properly handle non-latin characters Description: ------------ The function str_word_count() does work properly on non-latin characters. It will return a value of zero. Whereas str_word_count() works properly on latin characters and returns the value for the number of words in a string. Test script: --------------- <?php print str_word_count("PHP function str_word_count does not properly handle non-latin characters") . "\n"; // returns 11 print str_word_count("Хабилло житель Яванского района. Ему 70 лет. Он женат. У него четверо детей. Хабилло филолог. Он более двадцати лет работает по профессии. Также Хабилло занимается виноградарством. У него имеется небольшой виноградник. Этим видом деятельности Хабилло занимается 15 лет."); // returns 0, but should return 37 Expected result: ---------------- The second instruction should return 37 Actual result: -------------- The second instruction returns 0 -- Edit bug report at https://bugs.php.net/bug.php?id=63663&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=63663&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=63663&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=63663&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=63663&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=63663&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=63663&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=63663&r=needscript Try newer version: https://bugs.php.net/fix.php?id=63663&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=63663&r=support Expected behavior: https://bugs.php.net/fix.php?id=63663&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=63663&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=63663&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=63663&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63663&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=63663&r=dst IIS Stability: https://bugs.php.net/fix.php?id=63663&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=63663&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=63663&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=63663&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=63663&r=mysqlcfg

« previous php.bugs (#175054) next »