0
0
Fork 0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2024-11-22 02:15:12 +00:00

[utils] Correct decoding of large unicode codepoints in uppercase_escape (Fixes #2664)

This commit is contained in:
Philipp Hagemeister 2014-04-01 13:17:07 +02:00
parent c8fc3fb524
commit a612753db9

View file

@ -1264,8 +1264,8 @@ def getslice(self, start=0, end=None):
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)