# HG changeset patch # User HackBot # Date 1394190327 0 # Node ID 68b049bc9d4e337f291df20773ce5ddf625f7a42 # Parent 7efc6d484fe6d367d5c34d985ac51200f3995624 sed -i -e \'s/{4}/{1,4}/\' bin/unicode diff -r 7efc6d484fe6 -r 68b049bc9d4e bin/unicode --- a/bin/unicode Fri Mar 07 11:04:58 2014 +0000 +++ b/bin/unicode Fri Mar 07 11:05:27 2014 +0000 @@ -3,7 +3,7 @@ import re import sys import unicodedata -def l(c): m = re.match('(?:U+)?([0-9a-f]{4})$', c, re.I); return unicodedata.lookup(c) if m is None else unichr(int(m.group(1),16)) +def l(c): m = re.match('(?:U+)?([0-9a-f]{1,4})$', c, re.I); return unicodedata.lookup(c) if m is None else unichr(int(m.group(1),16)) try: print u''.join(map(l, sys.argv[1:])).encode('utf-8') except KeyError: