Thanks a lot Skip. Sure that this will help.

Learned two things: how to do it and to look at the docs for 2.5 also.

These samples are not in the 2.4.2 reference guide.

Rudy

On 2/24/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

    Rudy> I'm having problems writing unicode to a csv file.
    Rudy> I use the following code:
    ...

Have you tried the example UnicodeReader and UnicodeWriter classes in the
module documentation:

    http://www.python.org/dev/doc/devel/lib/node631.html

While the csv module is 8-bit clean it knows nothing about Unicode, so your
Unicode data has to be encoded before it hits the csv module code.  Your
code is expecting the Unicode to go through the csv module and be encoded to
utf-8 downstream in the by the eventual file object.

If there are people reading this who would like to tackle something for
Python 2.5, I am sure a patch that Unicodifies the csv module would be
welcome.

Skip



--
It is not economical to go to bed early to save the candles if the result is twins. - Chinese Proverb
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to