|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-12-24 06:16 UTC] js9s at lycos dot com
Description:
------------
setlocale works only partially.
Following code won't work:
$ulang="zh_CN";
$ulang_1=$ulang;
putenv ("LC_ALL=$ulang_1");
$locale=setlocale(LC_ALL,$ulang_1);
The $locale is always null;
However, following works:
$ulang="zh_CN";
putenv ("LC_ALL=$ulang");
$locale=setlocale(LC_ALL,$ulang);
where $locale returns correct "zh_CN"
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 02:00:01 2025 UTC |
sorry, this one won't work: class test { var $locale; tese() { $this->locale='zh_CN'; } function getLocale() { return $this->locale; } } $test = new Test; $ulang=$test->getLocale(); putenv ("LC_ALL=$ulang"); $locale=setlocale(LC_ALL,$ulang); The $locale is always null; The other cases it works.