I'm at my wits end on this one. I need to write some Chinese characters to a text file. The following method works however the newlines get stripped so the resulting file is just one super long string.
I tried inserting every known unicode line break that I know of and nothing. Any help is greatly appreciated. Here is 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'))# where \u2424 is unicode line break