From:             jchochola at demsys dot cz
Operating system: GNU/Linux
PHP version:      5.2.10
PHP Bug Type:     I18N and L10N related
Bug description:  Case sensitivity in setlocale()

Description:
------------
setlocale( LC_ALL, 'Czech' ) does not work in my ISP's environment; one
has to use lowercase 'czech' instead. The ISO639 (mentioned in setolcale()
docs) lists country names with capitalized first letters, ie. setlocale()
should accept 'Czech' or not to mention ISO639 at all.

'Czech' locale is OK under XAMPP used for local debugging.

I can't imagine why such functions should use case-sensitive string
params.


Reproduce code:
---------------
//---
//From manual page: function.setlocale
//---
function e( $s ) {
  eval( '$r = '.$s.';' );
  echo $s, ' returns ', $r ? 'true (\''.$r.'\')' : 'false', "\n";
}
e( "setlocale( LC_ALL, 'Czech' )" );
e( "setlocale( LC_ALL, 'czech' )" );


Expected result:
----------------
setlocale( LC_ALL, 'Czech' ) returns true ('Czech')
setlocale( LC_ALL, 'czech' ) returns true ('czech')


Actual result:
--------------
setlocale( LC_ALL, 'Czech' ) returns false
setlocale( LC_ALL, 'czech' ) returns true ('czech')



-- 
Edit bug report at http://bugs.php.net/?id=49520&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=49520&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=49520&r=trysnapshot53
Try a snapshot (PHP 6.0):            
http://bugs.php.net/fix.php?id=49520&r=trysnapshot60
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=49520&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=49520&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=49520&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=49520&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=49520&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=49520&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=49520&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=49520&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=49520&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=49520&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=49520&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=49520&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=49520&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=49520&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=49520&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=49520&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=49520&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=49520&r=mysqlcfg

Reply via email to