[issue12568] Add functions to get the width in columns of a character

Tom Christiansen report at bugs.python.org
Fri Aug 12 04:28:02 CEST 2011


Tom Christiansen <tchrist at perl.com> added the comment:

I can attest that being able to get the columns of a grapheme cluster is very important for printing, because you need this to do correct linebreaking.  There might be something you can steal from 

   http://search.cpan.org/perldoc?Unicode::GCString
   http://search.cpan.org/perldoc?Unicode::LineBreak

which implements UAX#14 on linebreaking and UAX#11 on East Asian widths.  

I use this in my own code to help format Unicode strings my columns or lines.  The right way would be to build this sort of knowledge into string.format(), but that is much harder, so an intermediary library module seems good enough for now.

----------
nosy: +tchrist

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


More information about the Python-bugs-list mailing list