#49520 [Opn]: Case sensitivity in setlocale()

From: Date: Thu, 10 Sep 2009 11:11:13 +0000
Subject: #49520 [Opn]: Case sensitivity in setlocale()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-142214@lists.php.net to get a copy of this message
ID: 49520 User updated by: jchochola at demsys dot cz Reported By: jchochola at demsys dot cz Status: Open Bug Type: I18N and L10N related -Operating System: GNU/Linux +Operating System: Debian 4.0 PHP Version: 5.2.10 New Comment: OS rectification received from my ISP. Previous Comments: ------------------------------------------------------------------------ [2009-09-10 10:43:11] jchochola at demsys dot cz 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 this bug report at http://bugs.php.net/?id=49520&edit=1

« previous php.bugs (#142214) next »