From 2b034e7a41b78a622118a8a570106e9124feb07f Mon Sep 17 00:00:00 2001 From: mutantmonkey Date: Sun, 11 Dec 2011 18:09:42 -0500 Subject: [PATCH] fix .u --- modules/codepoints.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/modules/codepoints.py b/modules/codepoints.py index 61ddfe8..10e726c 100755 --- a/modules/codepoints.py +++ b/modules/codepoints.py @@ -70,13 +70,13 @@ def u(phenny, input): # phenny.msg('#inamidst', '%r' % arg) if not arg: return phenny.reply('You gave me zero length input.') - elif not arg.strip(b' '): + elif not arg.strip(' '): if len(arg) > 1: return phenny.reply('%s SPACEs (U+0020)' % len(arg)) return phenny.reply('1 SPACE (U+0020)') # @@ space if set(arg.upper()) - set( - b'ABCDEFGHIJKLMNOPQRSTUVWYXYZ0123456789- .?+*{}[]\\/^$'): + 'ABCDEFGHIJKLMNOPQRSTUVWYXYZ0123456789- .?+*{}[]\\/^$'): printable = False elif len(arg) > 1: printable = True @@ -84,7 +84,7 @@ def u(phenny, input): if printable: extended = False - for c in b'.?+*{}[]\\/^$': + for c in '.?+*{}[]\\/^$': if c in arg: extended = True break @@ -94,8 +94,6 @@ def u(phenny, input): except ValueError: pass else: return phenny.say(about(u)) - arg = arg.decode('utf-8') - if extended: # look up a codepoint with regexp results = list(islice(codepoint_extended(arg), 4)) @@ -113,7 +111,7 @@ def u(phenny, input): phenny.say(result) else: phenny.reply("Sorry, no results for %r." % arg) else: - text = arg.decode('utf-8') + text = arg # look up less than three podecoints if len(text) <= 3: for u in text: