All pastes #295403 Raw Edit

Stuff

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