X-Git-Url: https://mudpy.org/gitweb?p=mudpy.git;a=blobdiff_plain;f=lib%2Fmudpy%2Fmisc.py;h=d8c863ab80032e103882c5163fdb545ba21c73cb;hp=b39610be5b177f959af9509ef6732974a981f9b9;hb=d92cf2f5ca5d8c4c0cd57d2a8bd0920d6ad22382;hpb=e27b1c4b71ab9cad6b2e41d7ff2cf41c3d8b8d3e diff --git a/lib/mudpy/misc.py b/lib/mudpy/misc.py index b39610b..d8c863a 100644 --- a/lib/mudpy/misc.py +++ b/lib/mudpy/misc.py @@ -1202,7 +1202,11 @@ def wrap_ansi_text(text, width): escape = False # normalize any potentially composited unicode before we count it - text = unicodedata.normalize("NFKC", text) + # TODO: remove this check after the switch to py3k + try: + text = unicodedata.normalize("NFKC", text) + except TypeError: + text = unicodedata.normalize("NFKC", unicode(text)) # iterate over each character from the begining of the text for each_character in text: