php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26708 setlocale has bugs
Submitted: 2003-12-24 06:16 UTC Modified: 2003-12-24 07:37 UTC
From: js9s at lycos dot com Assigned:
Status: Not a bug Package: *Languages/Translation
PHP Version: 4.3.3 OS: LINUX
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: js9s at lycos dot com
New email:
PHP Version: OS:

 

 [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"







Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-12-24 06:36 UTC] js9s at lycos dot com
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.
 [2003-12-24 07:37 UTC] moriyoshi@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.


class test {
var $locale;
   
    tese() {
    ^^^^

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 17:01:58 2024 UTC