|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-10-26 02:16 UTC] mehmetyucel at gmail dot com
Description:
------------
If the localization that is set by setlocale has non ISO-8859-1 characters strftime destroys these.
Reproducable on both Fedora Core 5 and Windows 2003 Enterprise Server tested for 2 languages (Spanish / Turkish)
Reproduce code:
---------------
header('Content-Type: text/html; charset=utf-8');
setlocale(LC_TIME,"spanish");
echo strftime("%d %B %Y %A",strtotime("2006-10-28"))."<br>";
setlocale(LC_TIME,"turkish");
echo strftime("%d %B %Y %A",strtotime("2006-10-26"))."<br>";
echo strftime("%d %B %Y %A",strtotime("2006-10-25"))."<br>";
Expected result:
----------------
28 octubre 2006 s?bado
26 Ekim 2006 Perşembe
25 Ekim 2006 ?arşamba
Actual result:
--------------
28 octubre 2006 sᢡdo
26 Ekim 2006 Per?r>25 Ekim 2006 ǡr?r>
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 00:00:02 2025 UTC |
5.2 snapshot solved the issue on linux, but problem still exists for windows. Somehow setlocale sets output encoding of strftime. Following works as a temporary solution for window env. iconv("ISO-8859-9","UTF-8",strftime("%d %B %Y %A",strtotime("2006-10-26")));