Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Why does setlocale(LC_ALL, 'en_GB.UTF8'); return false on Windows Server 2003 R2 - Zend CE PHP 5.3.5 ?

Function in question: setlocale.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
486 views
Welcome To Ask or Share your Answers For Others

1 Answer

From the PHP Manual:

The return value of setlocale() depends on the system that PHP is running. It returns exactly what the system setlocale function returns.

So in your case it returns false because the system returns false. It is likely that the locale you're using is not available on your system.

A list of setlocale strings supported by Windows is available here. For British English you want eng, english-uk, or uk. Windows doesn't support multi-byte character sets like UTF-8 though; you will probably end up with Windows-1252.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...