#31064 [Opn->Bgs]: str_word_count and german umlauts and ligatures

From: Date: Sun, 12 Dec 2004 13:54:48 +0000
Subject: #31064 [Opn->Bgs]: str_word_count and german umlauts and ligatures
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-70070@lists.php.net to get a copy of this message
 ID:               31064
 Updated by:       derick@php.net
 Reported By:      km at control-b dot de
-Status:           Open
+Status:           Bogus
 Bug Type:         Strings related
 Operating System: windows
 PHP Version:      5.0.2
 New Comment:

This is not a bug, PHP doesn't know anything about UTF8 encodings and
will split up a word if it's not [A-z].


Previous Comments:
------------------------------------------------------------------------

[2004-12-12 01:57:22] km at control-b dot de

Description:
------------
str_word_count return wrong number, if german umlaut "ö" (ö) is
contained in the word. 
it is okay, if the umlaut is the first or the last character.

the same goes für the ligature "ß" ß.



Reproduce code:
---------------
echo str_word_count('wäre');         # 1 - okay
echo str_word_count('würde');        # 1 - okay
echo str_word_count('wérk');         # 1 - okay
echo str_word_count('wörk');         # 2 - wrong!!!
echo str_word_count('örk');          # 1 - okay
echo str_word_count('werök');        # 2 - wrong!!!
echo str_word_count('weräk');        # 1 - okay


echo str_word_count('straßenbahnölbehälter'); # 3 words???

Expected result:
----------------
the above code should return always 1



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=31064&edit=1


Thread (3 messages)

« previous php.bugs (#70070) next »