PHP 5.2.5 CGI and setlocale() nl_NL

dwm

Verified User
Joined
Dec 4, 2007
Messages
64
Location
Netherlands
I reall cannot get setlocale working for nl_NL. I haved edited the php.ini and set the default to nl_NL:

;;;;;;;;;;;;;;;;;;;
; Module Settings ;
;;;;;;;;;;;;;;;;;;;

[Date]
; Defines the default timezone used by the date functions
date.timezone = nl_NL

Restarted the httpserver but did not work yet. I then checked for the nl_NL locale to be installed on my server, and it looks it IS installed:

# cat /usr/share/i18n/SUPPORTED |grep nl
nl_BE.UTF-8 UTF-8
nl_BE ISO-8859-1
nl_BE@euro ISO-8859-15
nl_NL.UTF-8 UTF-8
nl_NL ISO-8859-1
nl_NL@euro ISO-8859-15

Using this php code:
Code:
<?php
header('Content-type: text/html; charset=utf-8');
/*
nl_BE.UTF-8 UTF-8
nl_BE ISO-8859-1
nl_BE@euro ISO-8859-15
nl_NL.UTF-8 UTF-8
nl_NL ISO-8859-1
nl_NL@euro ISO-8859-15
*/
setlocale (LC_ALL, 'nl_NL');
echo strftime('%A %d %B %Y',time());
?>

I get this output (In American/English):
Saturday 29 December 2007

But in dutch (Netherlands) it should be:

Zaterdag 29 December 2007

Does anyone knows how this is possible, or how i have to fix this?
I am running apache 2.0 and php 5.2.5 CGI with suPHP.
 
I can't believe there hasn't been a single answer in 3 years...

Perhaps you've already fixed it, but in case someone else comes wandering in to this thread hoping the solution can be found here, here's what I did to fix it.

Do not use nl_NL as the locale, use nl_NL.ISO8859-1. Ofcourse, the language pack for nl_NL has to be installed.

locale -a | grep nl

should tell you wether it is installed (and can be found) or not.
 
Back
Top