#21708 [NEW]: ucfirst() trouble again
| From: | overseas at mtu-net dot ru | Date: | Fri, 17 Jan 2003 09:49:30 +0000 |
| Subject: | #21708 [NEW]: ucfirst() trouble again | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-30336@lists.php.net to get a copy of this message | ||
From: overseas@mtu-net.ru
Operating system: Win 2000 Pro Russian + SP2
PHP version: 4.3.0
PHP Bug Type: Strings related
Bug description: ucfirst() trouble again
This bug only for Win32 =)
ucwords() function once again does not work properly with strings
containing international characters.
Thus, any character following the "þ"(ACSII code == 254) or "Þ"(ACSII code
== 222) letter will always be uppercase.
Code:
<?
setlocale(LC_CTYPE,"ru_RU.cp1251");
$str[] = "ÏÐÎÑÒÎ";
$str[] = "ÒÞÐÜÌÀ";
$str[] = "ËþÁÎÂÍÈÊ";
$str[] = "ËÞÁÎÂÍÈÊ";
$str[] = "ËÓÁÎÂÍÈÊ =)";
$str[] = "ËÞÄÈ";
$str[] = "ëþäè";
for ($i=0;$i<sizeof($str);$i++) {
echo ucwords(strtolower($str[$i]))."<br>";
}
?>
Result:
Ïðîñòî
ÒþÐüìà
ËþÁîâíèê
ËþÁîâíèê
Ëóáîâíèê =)
ËþÄè
ËþÄè
--
Edit bug report at http://bugs.php.net/?id=21708&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=21708&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=21708&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=21708&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=21708&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=21708&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=21708&r=support
Expected behavior: http://bugs.php.net/fix.php?id=21708&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=21708&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=21708&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=21708&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=21708&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=21708&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=21708&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=21708&r=gnused