mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-11-23 11:31:47 +01:00
[utils] Ensure RFC3986 encoding result is unicode
This commit is contained in:
parent
a8d5316aaf
commit
556862bc91
|
@ -3970,7 +3970,8 @@ def escape_rfc3986(s):
|
||||||
"""Escape non-ASCII characters as suggested by RFC 3986"""
|
"""Escape non-ASCII characters as suggested by RFC 3986"""
|
||||||
if sys.version_info < (3, 0) and isinstance(s, compat_str):
|
if sys.version_info < (3, 0) and isinstance(s, compat_str):
|
||||||
s = s.encode('utf-8')
|
s = s.encode('utf-8')
|
||||||
return compat_urllib_parse.quote(s, b"%/;:@&=+$,!~*'()?#[]")
|
# ensure unicode: after quoting, it can always be converted
|
||||||
|
return compat_str(compat_urllib_parse.quote(s, b"%/;:@&=+$,!~*'()?#[]"))
|
||||||
|
|
||||||
|
|
||||||
def escape_url(url):
|
def escape_url(url):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user