#31064 [Bgs]: str_word_count and german umlauts and ligatures
| From: | km at control-b dot de | Date: | Mon, 13 Dec 2004 20:19:50 +0000 |
| Subject: | #31064 [Bgs]: str_word_count and german umlauts and ligatures | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-70169@lists.php.net to get a copy of this message | ||
ID: 31064
User updated by: km at control-b dot de
Reported By: km at control-b dot de
Status: Bogus
Bug Type: Strings related
Operating System: windows
PHP Version: 5.0.2
New Comment:
well, i think that has nothing to do with utf-8 encoding. (it is
misdecoded in the email!)
i type the text, as it is, in german (no encodings or entities are
used).
what bothers me, is the fact, that it works with all german umlauts
expect "ö" and the "Ã".
when it works for ä and ü, but not für ö, it must be a bug!
so the question is, if there are more person, like me, who discovered
this!
Previous Comments:
------------------------------------------------------------------------
[2004-12-12 14:54:46] derick@php.net
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].
------------------------------------------------------------------------
[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