Python requests encoding và UTF8-BOM
Python requests
requestsimport requests
resp = requests.get('https://example.com/link-text-file.vtt')
print(resp.headers.get('Content-Type')) # text/vtt
print(resp.apparent_encoding) # utf-8
print(resp.encoding) # ISO-8859-1UTF8 with and without BOM
Last updated