|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2007-06-22 05:11 UTC] rozvinbm_jp at yahoo dot co dot jp
Description: ------------ OS ---- Windows XP Home Edition SP2 Japanese Version with updated hotfixes PHP.ini changes ---- precision = 14 output_buffering = 4096 allow_call_time_pass_reference = Off variables_order = "GPCS" register_long_arrays = Off magic_quotes_gpc = Off Reproduce code: --------------- It is a jpg file because it maybe the chinese character does not support this forum. ---- http://anime.geocities.jp/rozvinbm_jp/reproducecode.JPG echo $dt1; echo $dt2; Expected result: ---------------- http://anime.geocities.jp/rozvinbm_jp/expectedresult.JPG Actual result: -------------- http://anime.geocities.jp/rozvinbm_jp/actualresult.JPG PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 03:00:01 2025 UTC |
Yes, I got it - and this is not a bug in PHP. The first japanese character (for year) in its Shift-Jis encoding (that's the encoding you were using in the script that you sent me) includes as second byte the "n" character. The "n" character is also a modifier letter for the date() function call. As PHP 4 and PHP 5 do not support Unicode here this does not work. There are two solutions: 1. Encode your scripts in UTF-8 2. break up the date call like: echo date("Y", $ts) . "YEARCHAR" . date("m", $ts) . "MONTHCHAR"....