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

2018-01-28 Thread Chason Chaffin

Change by Chason Chaffin :


--
nosy: +chason.chaffin

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2018-01-28 Thread Robert Booth

Robert Booth  added the comment:

There is similar misaligned output in Japanese and Korean:

Korean:
 1월2월3월
월  화  수  목  금  토  일   월  화  수  목  금  토  일   월  화  수  목  금  토  일
 1  2  3  4  5  6  71  2  3  41  2  3  4
 8  9 10 11 12 13 14   5  6  7  8  9 10 11   5  6  7  8  9 10 11

Japanese:
 1月2月3月
月  火  水  木  金  土  日   月  火  水  木  金  土  日   月  火  水  木  金  土  日
 1  2  3  4  5  6  71  2  3  41  2  3  4
 8  9 10 11 12 13 14   5  6  7  8  9 10 11   5  6  7  8  9 10 11

I came across this issue while using khal, a command-line calendar. That 
program also uses the calendar.LocaleTextCalendar class. I've raised an issue 
at https://github.com/pimutils/khal/issues/751

--
nosy: +ishigoya

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2013-02-02 Thread Terry J. Reedy

Terry J. Reedy added the comment:

For this particular East Asian local, the problem is the double spacing between 
the double-width characters (the Chinese numbers 1 to 7). This is potentially 
easily fixed for this locale. But do all locales have abbreviated weekday names 
that fit in 2 columns?

In looking at whether this issue should be classified as a bug or feature 
issue, I only found this:
'''
 class calendar.LocaleTextCalendar(firstweekday=0, locale=None)

This subclass of TextCalendar can be passed a locale name in the 
constructor and will return month and weekday names in the specified locale.'''

The current code does this, though not gracefully. I suspect that adding -t 
html to the command line, to use class calendar.LocaleHTMLCalendar, would work 
better.

[Doc note 1: I suspect the next sentence If this locale includes an encoding 
all strings containing month and weekday names will be returned as unicode., 
which is unchanged from 2.x, is obsolete and perhaps should just be removed.

Doc note 2: I could not find any doc for the command line interface in 
8.2. calendar — General calendar-related functions. Unless I am missing 
something, a new section should be added.]

#12568 will add a new feature that will only go in the 'next' release. So if 
this issue depends on that issue, it is effectively a new feature also.

--
nosy: +rhettinger, terry.reedy
stage:  - needs patch
type:  - enhancement
versions: +Python 3.4 -Python 2.7, Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17048
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2013-02-02 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17048
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2013-01-27 Thread Robert Xiao

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 rep...@bugs.python.org
http://bugs.python.org/issue17048
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2013-01-27 Thread Robert Xiao

Robert Xiao added the comment:

This is also a problem in Python 2.7 after the patch in issue17049 is applied.

--
versions: +Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17048
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2013-01-27 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
dependencies: +Add functions to get the width in columns of a character

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17048
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com