[New-bugs-announce] [issue8304] strftime and Unicode characters

AndiDog report at bugs.python.org
Sat Apr 3 17:08:44 CEST 2010

New submission from AndiDog <AndiDog at web.de>:

There is inconsistent behavior in time.strftime, comparing Python 2.6 and 3.1. In 3.1, non-ASCII Unicode characters seem to get dropped whereas in 2.6 you can keep them using the necessary Unicode-to-UTF8 workaround.

This should be fixed if it isn't intended behavior.

Python 2.6

>>> time.strftime(u"%d\u200F%A".encode("utf-8"), time.gmtime()).decode("utf-8")
>>> time.strftime(u"%d\u0041%A".encode("utf-8"), time.gmtime()).decode("utf-8")

Python 3.1

>>> time.strftime("%d\u200F%A", time.gmtime())
>>> len(time.strftime("%d\u200F%A", time.gmtime()))
>>> time.strftime("%d\u0041%A", time.gmtime())

components: Library (Lib), Unicode
messages: 102269
nosy: AndiDog
severity: normal
status: open
title: strftime and Unicode characters
type: behavior
versions: Python 2.6, Python 3.1

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list