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