I tried the python code to get a json list of supported languages.
But I got this error:
UnicodeEncodeError: ‘charmap’ codec can’t encode character ‘\u010c’ in position 209: character maps to <undefined>
THE FIX:
import http.client
conn = http.client.HTTPSConnection(“google-news13.p.rapidapi.com”)
headers = {
‘X-RapidAPI-Key’: “YOUR KEY”
}
conn.request(“GET”, “/languageRegions”, headers=headers)
res = conn.getresponse()
data = res.read().decode(“utf-8”)
print(data.encode(“utf-8”))
Join in the discussion - add comment below: