Python and encodings drives me crazy
Oliver Andrich
oliver.andrich at gmail.com
Mon Jun 20 17:29:18 EDT 2005
Well, I narrowed my problem down to writing a macroman or cp850 file
using the codecs module. The rest was basically a misunderstanding
about codecs module and the wrong assumption, that my input data is
iso-latin-1 encode. It is UTF-8 encoded. So, curently I am at the
point where I have my data ready for writing....
Does the following code write headline and caption in MacRoman
encoding to the disk? Or better that, is this the way to do it?
headline and caption are both unicode strings.
f = codecs.open(outfilename, "w", "macroman")
f.write(headline)
f.write("\n\n")
f.write(caption)
f.close()
Best regards,
Oliver
--
Oliver Andrich <oliver.andrich at gmail.com> --- http://fitheach.de/
More information about the Python-list
mailing list