From:             k-yamashita at ver2 dot jp
Operating system: Windows
PHP version:      5.5.0
Package:          Date/time related
Bug Type:         Bug
Bug description:strftime() returns insufficient-length string under multibyte 
locales

Description:
------------
VC11's strftime() returns number of wide characters rather than bytes but
PHP seems to rely on it to determine byte length.

http://connect.microsoft.com/VisualStudio/feedback/details/766205/vs2012-strftime-has-incorrect-return-value-in-vc-11-with-multibyte-codepages


Test script:
---------------
<?php
setlocale(LC_ALL, 'Japanese_Japan.932');
echo strftime('%A');


Expected result:
----------------
>php a.php | od -t x1
0000000 90 85 97 6a 93 fa
0000006

Above is Shift JIS encoded Japanese word for "Wednesday". Other week days
are all 6 bytes long too.


Actual result:
--------------
>php a.php | od -t x1
0000000 90 85 97
0000003


-- 
Edit bug report at https://bugs.php.net/bug.php?id=65184&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=65184&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=65184&r=trysnapshot53
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=65184&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=65184&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=65184&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=65184&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=65184&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=65184&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=65184&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=65184&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=65184&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=65184&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=65184&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=65184&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=65184&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=65184&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=65184&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=65184&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=65184&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=65184&r=mysqlcfg

Reply via email to