Bug #65371 [Fbk->Asn]: strftime() returns insufficient string

From: Date: Sat, 11 Jan 2014 13:39:27 +0000
Subject: Bug #65371 [Fbk->Asn]: strftime() returns insufficient string
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-183718@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=65371&edit=1

 ID:                 65371
 User updated by:    kenji dot uui at gmail dot com
 Reported by:        kenji dot uui at gmail dot com
 Summary:            strftime() returns insufficient string
-Status:             Feedback
+Status:             Assigned
 Type:               Bug
 Package:            Date/time related
 Operating System:   Windows
 PHP Version:        5.5.1
 Assigned To:        ab
 Block user comment: N
 Private report:     N

 New Comment:

I found Windows system locale affects the result.
I changed it to English(US), then I got expected result.

The problem occurs in Japanese locale.


Previous Comments:
------------------------------------------------------------------------
[2014-01-09 12:36:10] ab@php.net

Ok, sadly I can't reproduce it neither with 5.4 nor with 5.5, got your expected result with CLI
and built-in server. There has to be something in your env causing this. Maybe you could try on some
other machine, with some other locale, etc? Also note that under apache the locale is not thread
safe (as apache under windows is threads based), there it might be possible because of it.

Thanks.

------------------------------------------------------------------------
[2014-01-07 05:21:23] kenji dot uui at gmail dot com

I've checked PHP 5.5.6, but not yet fixed. Thanks.

Results:
----------------
あ
ぁE
e38182
e3818145

------------------------------------------------------------------------
[2014-01-02 13:52:06] ab@php.net

Please check with bug #65184, the issue your report looks very similar and is most likely already
fixed.

Thanks.

------------------------------------------------------------------------
[2013-08-01 11:42:42] kenji dot uui at gmail dot com

Description:
------------
strftime() breaks UTF-8 Japanese characters.

It worked fine in PHP 5.4.

Test script:
---------------
<?php
function p($str)
{
  echo $str, '<br>';
  echo strftime($str), '<br>';
  echo bin2hex($str), '<br>';
  echo bin2hex(strftime($str)), '<hr>';
}

setlocale(LC_ALL, 'C');
p('あ');


Expected result:
----------------
あ
あ
e38182
e38182


Actual result:
--------------
あ
ぁE
e38182
e3818145



------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=65371&edit=1


Thread (10 messages)

« previous php.bugs (#183718) next »