Staging
v0.5.1
https://github.com/python/cpython
Revision e9ddfbb41207328d5c89061067f3431e00711fda authored by Hye-Shik Chang on 04 August 2004, 07:38:35 UTC, committed by Hye-Shik Chang on 04 August 2004, 07:38:35 UTC
unicodedata.east_asian_width().  You can still implement your own
simple width() function using it like this:
    def width(u):
        w = 0
        for c in unicodedata.normalize('NFC', u):
            cwidth = unicodedata.east_asian_width(c)
            if cwidth in ('W', 'F'): w += 2
            else: w += 1
        return w
1 parent b5047fd
History
Tip revision: e9ddfbb41207328d5c89061067f3431e00711fda authored by Hye-Shik Chang on 04 August 2004, 07:38:35 UTC
SF #989185: Drop unicode.iswide() and unicode.width() and add
Tip revision: e9ddfbb

back to top