[issue12568] Add functions to get the width in columns of a character
report at bugs.python.org
Sat Mar 10 19:57:38 CET 2012
Tom Christiansen <tchrist at perl.com> added the comment:
>Martin v. L=C3=B6wis <martin at v.loewis.de> added the comment:
>> Martin, I think you meant to write "if w =3D=3D 'A':".
>> Some very common characters have ambiguous widths though (e.g. the Greek =
>alphabet), so you can't just raise an error for them.
>That's precisely why I don't think this should be in the library, but
>in the application. Application developers who need that also need
>to concern themselves with the border cases, and decide on how
>they need to resolve them.
The column-width of a string is not an application issue. It is
well-defined by Unicode. Again, please see how we've done it in
Perl, where tr11 is fully implemented. The columns() method from
Unicode::GCString always gives the right answer per the Standard for
any string, even what you are calling ambiguous ones.
This is not an applications issue -- at all.
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list