473,414 Members | 1,740 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

strftime and utf8

-------------------------------------------------
header('Content-Type: text/html;charset=utf-8');
setlocale(LC_ALL, array('el_GR', 'ell_grc'));
echo strftime('%a %d %b %Y');
-------------------------------------------------
The html above has a UTF-8 charset, but strftime returns a iso-8859-7
string (1 byte / char) end finally html has this output:
??? 10 ??? 2006.
I suspect the setlocale but when I remove it, it produces english dates
and not greek.

strftime must return something like
Tpi 10 Map 2006
(with greek chars) which is the
Thu 10 Mar 2006
equivalent

Thanks for your time.
Jan 24 '06 #1
1 3084
Chameleon wrote:
-------------------------------------------------
header('Content-Type: text/html;charset=utf-8');
setlocale(LC_ALL, array('el_GR', 'ell_grc'));
echo strftime('%a %d %b %Y');
-------------------------------------------------
The html above has a UTF-8 charset, but strftime returns a iso-8859-7
string (1 byte / char) end finally html has this output:
??? 10 ??? 2006.
I suspect the setlocale but when I remove it, it produces english dates
and not greek.

strftime must return something like
Tpi 10 Map 2006
(with greek chars) which is the
Thu 10 Mar 2006
equivalent

Thanks for your time.

aha!
iconv seems usefull ;-)
Jan 24 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Richard Shea | last post by:
Hi - I'm trying to use strftime to output the day of the week but I find that I always get told it's Monday. I have tried day, month, year etc and all come out correctly but as soon as I use %a I...
4
by: John Hunter | last post by:
>>> from datetime import date >>> dt = date(1005,1,1) >>> print dt.strftime('%Y') Traceback (most recent call last): File "<stdin>", line 1, in ? ValueError: year=1005 is before 1900; the...
5
by: Sheila King | last post by:
I have a web app that has been running just fine for several months under Python 2.2.2. We are preparing to upgrade the server to run Python 2.4.1. However, part of my web app is throwing an...
4
by: Andy Leszczynski | last post by:
Python 2.2/Unix >>time.strftime("%T") '22:12:15' >>time.strftime("%X") '22:12:17' Python 2.3/Windows >>time.strftime("%X")
2
by: Mike Conmackie | last post by:
Greetings, Is there any way to force strftime() to ignore locale settings when formatting the resulting string? I have a requirement to create a specific date-time string format in UTC. ...
1
by: Dennis Benzinger | last post by:
Is there a library with a strftime replacement which supports Unicode format strings? Bye, Dennis
3
by: HSeganfredo | last post by:
Folks, my code below truncates the output as: chars 0,200709 chars 0,1839 If I change to: i = strftime(date, 9, "%Y%m%d", brokentime); j = strftime(hour, 7, "%H%M%S", brokentime); it...
2
by: Giovanni Bajo | last post by:
Hello, I am trying to find a good way to portably get the output of strftime() and put it onto a dialog (I'm using PyQt, but it doesn't really matter). The problem is that I need to decode the...
3
by: Andrii V. Mishkovskyi | last post by:
2008/5/7 Alexandr N Zamaraev <tonal@promsoft.ru>: Unicode and str objects are not the same. Why do you think that this is a bug? Anyway, you can always use 'encode' method of unicode objects: ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.