[New-bugs-announce] [issue12568] Add functions to get the width in columns of a character

STINNER Victor report at bugs.python.org
Fri Jul 15 00:43:56 CEST 2011


New submission from STINNER Victor <victor.stinner at haypocalc.com>:

Some characters take more than one column in a terminal, especially CJK (chinese, japanese, korean) characters. If you use such character in a terminal without taking care of the width in columns of each character, the text alignment can be broken. Issue #2382 is an example of this problem.

#2382 and #6755 have patches implementing such function:
- unicode_width.patch of #2382 adds unicode.width() method
- ucs2w.c of #6755 creates a new ucs2w module with two functions: unichr2w() (width of a character) and ucs2w() (width of a string)

Use test_ucs2w.py of #6755 to test these new functions/methods.

----------
components: Unicode
messages: 140376
nosy: haypo, inigoserna
priority: normal
severity: normal
status: open
title: Add functions to get the width in columns of a character
versions: Python 3.3

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


More information about the New-bugs-announce mailing list