I get the following error when try to write in file:
UnicodeEncodeError('ascii', u'B\u1ea7u cua (B\u1ea7u cua 2017 )', 1, 2, 'ordinal not in range(128)'))
I try to write this text Bầu cua
in file:
f = codecs.open("13.txt", "a", "utf-8")
f.write("{}\n".format(title))
Also I tried to use title.encode()
It gives me a new error:
When I use .encode(text)
I get the following error: `
UnicodeDecodeError('ascii', 'B\xe1\xba\xa7u cua (B\xe1\xba\xa7u cua 2017 )\n', 1, 2, 'ordinal not in range(128)'))
`