Reputation: 839
I would like to write to a file in multiple language and after then store it in the cloud storage.this my code:
file=gcs.open(filename,'w',content_type='text/html; charset=utf-8')
file.write(str(content))
file.close()
How could I modify it ? thank you
Upvotes: 1
Views: 1520
Reputation: 10579
Looks like this might be an issue of encoding your string as UTF-8 before calling file.write
. How about:
file.write(content.encode('utf-8'))
Upvotes: 4