#26708 [Opn]: setlocale has bugs

From: Date: Wed, 24 Dec 2003 11:36:20 +0000
Subject: #26708 [Opn]: setlocale has bugs
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-52460@lists.php.net to get a copy of this message
ID: 26708 User updated by: js9s at lycos dot com Reported By: js9s at lycos dot com Status: Open Bug Type: *Languages/Translation Operating System: LINUX PHP Version: 4.3.3 New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [2003-12-24 06:16:19] 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" ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=26708&edit=1

« previous php.bugs (#52460) next »