note 46640 added to function.setlocale

From: Date: Mon, 18 Oct 2004 20:42:13 +0000
Subject: note 46640 added to function.setlocale
Groups: php.notes 
Request: Send a blank email to php-notes+get-78736@lists.php.net to get a copy of this message
!!WARNING!! The "locale" always depend on the server configuration. i.e.: When trying to use "pt_BR" on some servers you will ALWAYS get false. Even with other languages. The locale string need to be supported by the server. Sometimes there are diferents charsets for a language, like "pt_BR.utf-8" and "pt_BR.iso-8859-1", but there is no support for a _standard_ "pt_BR". This problem occours in Windows platform too. Here you need to call "portuguese" or "spanish" or "german" or... Maybe the only way to try to get success calling the function setlocale() is: setlocale(LC_ALL, "pt_BR", "pt_BR.iso-8859-1", "pt_BR.utf-8", "portuguese", ...); But NEVER trust on that when making functions like date conversions or number formating. The best way to make sure you are doing the right thing, is using the default "en_US" or "en_UK", by not calling the setlocale() function. Or, make sure that your server support the lang you want to use, with some tests. Remember that: Using the default locale setings is the best way to "talk" with other applications, like dbs or rpc servers, too. []s Pigmeu ---- Manual Page -- http://www.php.net/manual/en/function.setlocale.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+46640 Delete -- http://master.php.net/manage/user-notes.php?action=delete+46640&report=yes Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+46640&report=yes&reason=bad+code Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+46640&report=yes&reason=spam Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+46640&report=yes&reason=useless+example Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+46640&report=yes&reason=contains+commercial+links Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+46640&report=yes&reason=useless+note Reject -- http://master.php.net/manage/user-notes.php?action=reject+46640&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#78736) next »