aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--youtube/util.py4
1 files changed, 2 insertions, 2 deletions
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)