Skip to content

Commit

Permalink
take combining characters into account
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasballinger committed Nov 19, 2014
1 parent b4a006f commit 195c4ab
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions wcwidth/wcwidth.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@ def wcswidth(pwcs, n=None):
for char in pwcs[idx]:
wcw = wcwidth(char)
if wcw < 0:
ucs = ord(char)
if _bisearch(ucs, NONZERO_COMBINING):
continue
return -1
else:
width += wcw
Expand Down

0 comments on commit 195c4ab

Please sign in to comment.