Hi!

I am trying to write a UTF-8 file of UNICODE strings with a carriage
return at the end of each line (code below).

filOpen = codecs.open("c:\\temp\\unicode.txt",'w','utf-8')

str1 = u'This is a test.'
str2 = u'This is the second line.'
str3 = u'This is the third line.'

strCR = u"\u240D"

filOpen.write(str1 + strCR)
filOpen.write(str2 + strCR)
filOpen.write(str3 + strCR)

filOpen.close()

The output looks like
This is a test.␍This is the second line.␍This is the third
line.␍ when opened in Wordpad as a UNICODE file.

Thanks for your help!!
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to