Am 06.10.2011 05:40, schrieb Steven D'Aprano:
(4) Do all your processing in Unicode, not bytes.

(5) Encode the text into bytes using UTF-8 encoding.

(6) Write the bytes to a file.

Just wondering, why do you split the latter two parts? I would have used codecs.open() to open the file and define the encoding in a single step. Is there a downside to this approach?

Otherwise, I can only confirm that your overall approach is the easiest way to get correct results.

Uli
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to