note 73347 added to function.setlocale
| From: | szepeshazi at gmail dot com | Date: | Mon, 19 Feb 2007 03:11:42 +0000 |
| Subject: | note 73347 added to function.setlocale | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-123567@lists.php.net to get a copy of this message | ||
For those of you who are unfortunate enough (like me) to work in Windows environment, and try to set
the locale to a language _and_ to UTF-8 charset, and were unable to do it, here is a workaround.
For example to output the date in hungarian with UTF-8 charset, this will work:
$dateString = "%B %d., %A";
setlocale(LC_ALL,'hungarian');
$res=strftime($dateString);
echo(iconv('ISO-8859-1', 'UTF-8', $res));
If anybody knows how to set the locale on Windows to the equivalent of "hu_HU.UTF-8" on
unix, please do tell me.
----
Server IP: 202.67.10.139
Probable Submitter: 202.58.196.246
----
Manual Page -- http://www.php.net/manual/en/function.setlocale.php
Edit -- https://master.php.net/note/edit/73347
Del: integrated -- https://master.php.net/note/delete/73347/integrated
Del: useless -- https://master.php.net/note/delete/73347/useless
Del: bad code -- https://master.php.net/note/delete/73347/bad+code
Del: spam -- https://master.php.net/note/delete/73347/spam
Del: non-english -- https://master.php.net/note/delete/73347/non-english
Del: in docs -- https://master.php.net/note/delete/73347/in+docs
Del: other reasons-- https://master.php.net/note/delete/73347
Reject -- https://master.php.net/note/reject/73347
Search -- https://master.php.net/manage/user-notes.php