note 90919 added to function.setlocale
| From: | KariSderholmakaHaprog at osu1 dot php dot net | Date: | Sat, 16 May 2009 11:28:57 +0000 |
| Subject: | note 90919 added to function.setlocale | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-154658@lists.php.net to get a copy of this message | ||
It took me a while to figure out how to get a Finnish locale correctly set on Ubuntu Server with
Apache2 and PHP5.
At first the output for "locale -a" was this:
C
en_US.utf8
POSIX
I had to install a finnish language pack with
"sudo apt-get install language-pack-fi-base"
Now the output for "locale -a" is:
C
en_US.utf8
fi_FI.utf8
POSIX
The last thing you need to do after installing the correct language pack is restart Apache with
"sudo apache2ctl restart". The locale "fi_FI.utf8" can then be used in PHP5
after restarting Apache.
For setting Finnish timezone and locale in PHP use:
<?php
date_default_timezone_set('Europe/Helsinki');
setlocale(LC_ALL,
array('fi_FI.UTF-8','fi_FI@euro','fi_FI','finnish'));
?>
----
Server IP: 62.237.7.3
Probable Submitter: 80.220.62.122
----
Manual Page -- http://www.php.net/manual/en/function.setlocale.php
Edit -- https://master.php.net/note/edit/90919
Del: integrated -- https://master.php.net/note/delete/90919/integrated
Del: useless -- https://master.php.net/note/delete/90919/useless
Del: bad code -- https://master.php.net/note/delete/90919/bad+code
Del: spam -- https://master.php.net/note/delete/90919/spam
Del: non-english -- https://master.php.net/note/delete/90919/non-english
Del: in docs -- https://master.php.net/note/delete/90919/in+docs
Del: other reasons-- https://master.php.net/note/delete/90919
Reject -- https://master.php.net/note/reject/90919
Search -- https://master.php.net/manage/user-notes.php