From c45f60d3f5914d7924e9940c504bd3443f2eb8de Mon Sep 17 00:00:00 2001 From: James Taylor Date: Tue, 2 Mar 2021 18:38:42 -0800 Subject: util.py: Encode data using utf-8, not ascii MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jesús --- youtube/util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'youtube/util.py') diff --git a/youtube/util.py b/youtube/util.py index 3d5d030..1142c1d 100644 --- a/youtube/util.py +++ b/youtube/util.py @@ -236,9 +236,9 @@ def fetch_url_response(url, headers=(), timeout=15, data=None, if data is not None: method = "POST" if isinstance(data, str): - data = data.encode('ascii') + data = data.encode('utf-8') elif not isinstance(data, bytes): - data = urllib.parse.urlencode(data).encode('ascii') + data = urllib.parse.urlencode(data).encode('utf-8') if cookiejar_send is not None or cookiejar_receive is not None: # Use urllib req = urllib.request.Request(url, data=data, headers=headers) -- cgit v1.2.3