Repository: yt-dlp
Issue: Escape unicode cookies
Labels: enhancement,external issue,core:networking,core:cookies

### Checklist

- [x] I'm asking a question and **not** reporting a bug/feature request
- [X] I've looked through the [README](https://github.com/yt-dlp/yt-dlp#readme)
- [X] I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue)
- [X] I've searched the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar questions including closed ones

### Question

Encoding errors continue to occur each time I try to download from Cuetv. 

What I have tried:
 `--encoding=UTF-8`
 `--restrict-filenames`
Replacing cookies.txt with new one

How can solve it? I only know a little about programming, so please give me instructions in detail.

+) I found that modifying line 1228 of client.py to `values[i] = one_value.encode('UTF-8')` works (In fact, another error occurs, but let's solve this problem first.), but I'm afraid it will cause other errors. Is it OK to change the line? If there's a way to solve this without modifying client.py, please let me know.

### Verbose log

```shell
[debug] Command-line config: ['--cookies=cuetv.online_cookies.txt', '-F', 'https://www.cuetv.online/opera-ariane-et-barbe-bleue-p-dukas-theatre-du-capitole-2019/videos/opera-ariane-et-barbe-bleue-p-dukas-theatre-du-capitole-2019', '-vU']
[debug] Encodings: locale cp949, fs utf-8, out utf-8, err utf-8, pref cp949
[debug] yt-dlp version 2022.04.08 [7884ade65]
[debug] Python version 3.10.4 (CPython 64bit) - Windows-10-10.0.22000-SP0
[debug] Checking exe version: ffmpeg -bsfs
[debug] Checking exe version: ffprobe -bsfs
[debug] exe versions: ffmpeg 5.0.1-essentials_build-www.gyan.dev (setts), ffprobe 5.0.1-essentials_build-www.gyan.dev
[debug] Optional libraries: brotli, certifi, Cryptodome, mutagen, sqlite, websockets
[debug] Proxy map: {}
Latest version: 2022.04.08, Current version: 2022.04.08
yt-dlp is up to date (2022.04.08)
[debug] [generic] Extracting URL: https://www.cuetv.online/opera-ariane-et-barbe-bleue-p-dukas-theatre-du-capitole-2019/videos/opera-ariane-et-barbe-bleue-p-dukas-theatre-du-capitole-2019
[generic] opera-ariane-et-barbe-bleue-p-dukas-theatre-du-capitole-2019: Requesting header
ERROR: 'latin-1' codec can't encode characters in position 1714-1715: ordinal not in range(256)
Traceback (most recent call last):
  File "C:\Users\lg\AppData\Local\Programs\Python\Python310\lib\site-packages\yt_dlp\YoutubeDL.py", line 1408, in wrapper
    return func(self, *args, **kwargs)
  File "C:\Users\lg\AppData\Local\Programs\Python\Python310\lib\site-packages\yt_dlp\YoutubeDL.py", line 1478, in __extract_info
    ie_result = ie.extract(url)
  File "C:\Users\lg\AppData\Local\Programs\Python\Python310\lib\site-packages\yt_dlp\extractor\common.py", line 641, in extract
    ie_result = self._real_extract(url)
  File "C:\Users\lg\AppData\Local\Programs\Python\Python310\lib\site-packages\yt_dlp\extractor\generic.py", line 2728, in _real_extract
    head_response = self._request_webpage(
  File "C:\Users\lg\AppData\Local\Programs\Python\Python310\lib\site-packages\yt_dlp\extractor\common.py", line 767, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "C:\Users\lg\AppData\Local\Programs\Python\Python310\lib\site-packages\yt_dlp\YoutubeDL.py", line 3601, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "C:\Users\lg\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 519, in open
    response = self._open(req, data)
  File "C:\Users\lg\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 536, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "C:\Users\lg\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 496, in _call_chain
    result = func(*args)
  File "C:\Users\lg\AppData\Local\Programs\Python\Python310\lib\site-packages\yt_dlp\utils.py", line 1543, in https_open
    return self.do_open(functools.partial(
  File "C:\Users\lg\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 1348, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "C:\Users\lg\AppData\Local\Programs\Python\Python310\lib\http\client.py", line 1282, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "C:\Users\lg\AppData\Local\Programs\Python\Python310\lib\http\client.py", line 1323, in _send_request
    self.putheader(hdr, value)
  File "C:\Users\lg\AppData\Local\Programs\Python\Python310\lib\http\client.py", line 1255, in putheader
    values[i] = one_value.encode('latin-1')
UnicodeEncodeError: 'latin-1' codec can't encode characters in position 1714-1715: ordinal not in range(256)
```