1

Possible Duplicate:
setlocale(LC_ALL, β€˜en_GB.UTF8’) not working on windows

I have the following PHP code:

setlocale(LC_TIME, "fi_FI");
echo strftime(" in Finnish is %A, %B %d, %G at %l:%M%p");
setlocale(LC_TIME, "fr_CA");
echo strftime(" in French Canadian is %A, %B %d, %G at %l:%M%p");

Problems:

  1. On my Windows machine, it displays as English. How do I configure PHP or Windows to make this work right?
  2. On my Linux machine, it displays this:

    • in Finnish is maanantai, lokakuu 15, 2012 at 6:42
    • in French Canadian is lundi, octobre 15, 2012 at 6:42

Any ideas why the words are in lower case?

Community
  • 1
  • 1
StackOverflowNewbie
  • 39,403
  • 111
  • 277
  • 441

1 Answers1

2

On your windows machine, the locale names you are setting might not be available. According to the documentation on setlocale(), the valid locale strings, are available at MSDN.

Your strings, for windows would be

French Canadian: "frc" or "french-canadian"

Finnish: "fin" or "finnish"

The three-letter language-string codes are valid in Windows 2000 and later operating systems.

The months etc are all lower case because: The French and Finnish don't use capital letters for for days of the week and months. (Finnish) (French)

Community
  • 1
  • 1
Anirudh Ramanathan
  • 46,179
  • 22
  • 132
  • 191
  • oh ... if that's the case, then this output is correct. I just assumed it was supposed to be capitalized. Any ideas why it displays in English on my Windows machine? – StackOverflowNewbie Oct 16 '12 at 00:24
  • It shouldn't exhibit different behaviour. The locale string might not be working under windows. Check the [language string reference here](http://msdn.microsoft.com/en-us/library/39cwe7zf%28v=vs.90%29.aspx) – Anirudh Ramanathan Oct 16 '12 at 00:30