Skip to content

Commit

Permalink
[unicode_info] Support for specifying codepoints in the U+203D format
Browse files Browse the repository at this point in the history
Basically, if we find U+ at the start, we remove it.
This is the most common format for Unicode codepoints, so it makes sense to
support it.
  • Loading branch information
Elad Alfassa committed May 2, 2014
1 parent c13aa00 commit 31c17fd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions unicode_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ def codepoint(bot, trigger):
bot.reply('What code point do you want me to look up?')
return NOLIMIT
elif len(arg) > 1:
if arg.startswith('U+'):
arg = arg[2:]
try:
arg = unichr(int(arg, 16))
except:
Expand Down

0 comments on commit 31c17fd

Please sign in to comment.