I want to read a bson
file with utf-8
encoding but I don't know where to insert the encoding format.
here is my code:
with open('filename.bson','rb') as f:
data = bson.decode_all(f.read())
I want to read a bson
file with utf-8
encoding but I don't know where to insert the encoding format.
here is my code:
with open('filename.bson','rb') as f:
data = bson.decode_all(f.read())
You can insert encoding within open
function
with open('filename.bson','rb', encoding='utf-8') as f:
data = bson.decode_all(f.read())