From: Philipp Hagemeister Date: Tue, 1 Apr 2014 11:17:07 +0000 (+0200) Subject: [utils] Correct decoding of large unicode codepoints in uppercase_escape (Fixes ... X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=a612753db9c22556967bf60c2eee8a8e63cd98ba;p=youtube-dl [utils] Correct decoding of large unicode codepoints in uppercase_escape (Fixes #2664) --- diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index de9881372..e54ea9d61 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -1264,8 +1264,8 @@ class PagedList(object): def uppercase_escape(s): return re.sub( - r'\\U([0-9a-fA-F]{8})', - lambda m: compat_chr(int(m.group(1), base=16)), s) + r'\\U[0-9a-fA-F]{8}', + lambda m: m.group(0).decode('unicode-escape'), s) try: struct.pack(u'!I', 0)