Bug #14655: ucwords failing randomly with international characters

From: Date: Sat, 22 Dec 2001 03:32:30 +0000
Subject: Bug #14655: ucwords failing randomly with international characters
Groups: php.dev 
Request: Send a blank email to php-dev+get-74766@lists.php.net to get a copy of this message
From:             xtango@netcombbs.com.ar
Operating system: Windows XP Pro (spanish)
PHP version:      4.1.0
PHP Bug Type:     Strings related
Bug description:  ucwords failing randomly with international characters

When using the ucwords() function with strings containing international
characters, the function will return incorrect values. The return value
will be different every time the function is called.

I've seen bogus bug reports for this function so we have a slight chance
for this to be yet another bogus bug, but look at this:

echo setlocale(LC_ALL, "0");
Output:
LC_COLLATE=C;LC_CTYPE=Spanish_Argentina.1252;LC_MONETARY=C;LC_NUMERIC=C;LC_TIME=C

---
echo ucwords('ñáéíóúàèìòùäëïöü');
Output:
ÑáéíóúÀèìÒùäËïÖü
Output again (refresh button on browser):
ÑáÉíóúàèìòùäëïöÜ
Output again:
ÑáéíÓúàèìÒùäëïöÜ

etc. etc.

Now, if I do setlocale(LC_ALL, "spanish"), the restult is still the same.

I've noted that the problem is not the intl. char, but the char after that.
This is, ucwords("cañas") will return "Cañas" or "CañAs", randomly.

Scenario:
Windows XP Pro (spanish)
Apache 1.3.22
PHP 4.1.0

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



Thread (3 messages)

« previous php.dev (#74766) next »