CLI unescape util to handle unicode with linefeed correctly
def unescape(s):
- return (s.replace('\\r\\n', '\\n').decode('unicode_escape').encode('utf-8')
+ return (s.replace('\\r\\n', '\\n').encode('utf-8').decode('string_escape').decode('utf-8')
if isinstance(s, basestring) else s)
