All pastes #295394 Raw Edit

Unnamed

public text v1 · immutable
#295394 ·published 2006-12-29 10:54 UTC
rendered paste body
def get_width2( o ):
        """Return the screen column width for unicode ordinal o."""
        if o == 0xe or o == 0xf:
                return 0
        elif o > widths[-1][0]:
                return 1
        else:
                i = bisect.bisect_left(widths, (o, 0))
                return widths[i][1]