[New-bugs-announce] [issue17048] calendar should understand full- vs. half-width characters

Robert Xiao report at bugs.python.org
Sun Jan 27 09:38:10 CET 2013


New submission from Robert Xiao:

Try this at your command-prompt (requires utf8 support in the terminal emulator):

$ python3 -m calendar -L zh_CN -e utf8

The result is a mess like this:

                                  2013

         一月                        二月                        三月
一  二  三  四  五  六  日       一  二  三  四  五  六  日       一  二  三  四  五  六  日
    1  2  3  4  5  6                   1  2  3                   1  2  3
 7  8  9 10 11 12 13       4  5  6  7  8  9 10       4  5  6  7  8  9 10
14 15 16 17 18 19 20      11 12 13 14 15 16 17      11 12 13 14 15 16 17
21 22 23 24 25 26 27      18 19 20 21 22 23 24      18 19 20 21 22 23 24
28 29 30 31               25 26 27 28               25 26 27 28 29 30 31

Note the irregular spacing. The calendar module assumes that the characters are half-width, when in reality they are full-width characters.

calendar should use unicodedata.east_asian_width to determine if a character is full- or half-width, and adjust the spacing accordingly.

----------
components: Library (Lib)
messages: 180748
nosy: nneonneo
priority: normal
severity: normal
status: open
title: calendar should understand full- vs. half-width characters
versions: Python 3.2

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17048>
_______________________________________


More information about the New-bugs-announce mailing list