SUSE Linux setlocale not working

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

SUSE Linux setlocale not working

Post by CoderGoblin »

OK not used to linux (using SUSE) and cannot find out about the specific version but have retreived from phpinfo()
  • - System: Linux web1 2.6.9 #1 SMP Thu Nov 25 15:51:50 CET 2004 i686
    - php version: 4.3.11
    - Apache 2.0 Handler
The trouble is I cannot get setlocale to work, even using the example in the manual...

Code: Select all

/* Set locale to Dutch */
setlocale(LC_ALL, 'nl_NL');

/* Output: vrijdag 22 december 1978 */
echo strftime("%A %e %B %Y", mktime(0, 0, 0, 12, 22, 1978));

/* try different possible locale names for german as of PHP 4.3.0 */
$loc_de = setlocale(LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
echo "Preferred locale for german on this system is '$loc_de'";
The $loc_de is empty, the date always comes up in english.
Post Reply