I am on my way on this. I need to write some Chinese characters in a text file. The following method works, however, newlines become stripped, so the resulting file is only one super long line.
I tried to insert every known unicode line break that I know of and nothing. Any help is appreciated. Here is a snippet:
import codecs file_object = codecs.open( 'textfile.txt', "w", "utf-8" ) xmlRaw = (data to be written to text file ) newxml = xmlRaw.split('\n') for n in newxml: file_object.write(n+(u'2424'))
source share