def unescape_utf8(msg):
def sub(m):<EOL><INDENT>text = m.group(<NUM_LIT:0>)<EOL>if text[:<NUM_LIT:3>] == "<STR_LIT>": return unichr(int(text[<NUM_LIT:3>:-<NUM_LIT:1>], <NUM_LIT:16>))<EOL>else:                 return unichr(int(text[<NUM_LIT:2>:-<NUM_LIT:1>]))<EOL><DEDENT>return re.sub("<STR_LIT>", sub, urllib.unquote(msg))<EOL>
convert escaped unicode web entities to unicode