#19257 [NEW]: strtolower & strtoupper does not work for UTF-8 strings

From: Date: Thu, 05 Sep 2002 20:46:14 +0000
Subject: #19257 [NEW]: strtolower & strtoupper does not work for UTF-8 strings
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-18527@lists.php.net to get a copy of this message
From:             gamid@isayev.net
Operating system: Linux
PHP version:      4.2.2
PHP Bug Type:     Strings related
Bug description:  strtolower & strtoupper does not work for UTF-8 strings

Functions strtolower() & strtoupper() does not change UTF-8 strings.  I try
Russian (0x042F, 0x044F) and German (0x00DC, 0x00FC) characters.
Example:

<?
$str = "testЯ";

$loc = "UTF-8";
putenv("LANG=$loc");
$loc = setlocale(LC_ALL, $loc);

$strU = strtoupper($str);
$strL = strtolower($str);
?>
<PRE>
loc  = '<? echo $loc;  ?>'
str  = '<? echo $str;  ?>'
strU = '<? echo $strU; ?>'
strL = '<? echo $strL; ?>'
</PRE>

-- 
Edit bug report at http://bugs.php.net/?id=19257&edit=1
-- 
Try a CVS snapshot:  http://bugs.php.net/fix.php?id=19257&r=trysnapshot
Fixed in CVS:        http://bugs.php.net/fix.php?id=19257&r=fixedcvs
Fixed in release:    http://bugs.php.net/fix.php?id=19257&r=alreadyfixed
Need backtrace:      http://bugs.php.net/fix.php?id=19257&r=needtrace
Try newer version:   http://bugs.php.net/fix.php?id=19257&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=19257&r=support
Expected behavior:   http://bugs.php.net/fix.php?id=19257&r=notwrong
Not enough info:     http://bugs.php.net/fix.php?id=19257&r=notenoughinfo
Submitted twice:     http://bugs.php.net/fix.php?id=19257&r=submittedtwice
register_globals:    http://bugs.php.net/fix.php?id=19257&r=globals



Thread (18 messages)

« previous php.bugs (#18527) next »