CSV module and UNICODE
Rudy Schockaert
rudy.schockaert at gmail.com
Fri Feb 24 02:03:20 EST 2006
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, skip at pobox.com <skip at pobox.com> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20060224/61a75f79/attachment.html>
More information about the Python-list
mailing list