Mehdi Khlifi
06/30/2021, 1:32 PMwith open(jsonl_path, encoding='utf-8') as jsonl_file:
client.collections[name].documents.import_(jsonl_file.read(), {'action': 'create'})
It's returning:
UnicodeEncodeError: 'latin-1' codec can't encode characters in position 3340888-3340891: Body ('تونس') is not valid Latin-1. Use body.encode('utf-8') if you want to send it encoded in UTF-8.
When I do jsonl_file.read().encode('utf-8')
it returns TypeError: Object of type bytes is not JSON serializable
How can I solve this?Kishore Nallan
06/30/2021, 1:34 PMMehdi Khlifi
06/30/2021, 1:43 PMKishore Nallan
06/30/2021, 1:59 PMKishore Nallan
06/30/2021, 2:22 PMKishore Nallan
06/30/2021, 2:29 PM.encode('utf-8')
but it will work now.Mehdi Khlifi
06/30/2021, 2:58 PMKishore Nallan
06/30/2021, 3:44 PM