getting data with proper encoding to the finish

John Machin sjmachin at lexicon.net
Mon Mar 14 19:50:27 EST 2005


Ksenia Marasanova wrote:
> Sorry, I meant: I use field of the type 'text' in a Postgres table to
> store my data. The data is a XML string.
>
> > Instead of "print data", do "print repr(data)" and show us what you
> > get. What *you* see on the screen is not much use for diagnosis;
it's
> > the values of the bytes in the file that matter.
>
> Thanks for this valuable tip. I take letter "é" as an example.
>
> "print repr(data)" shows this:
> u'\xe9'

That doesn't look like an "XML string" to me. Show the WHOLE contents
of the field.

Have you read the docs of the Perl module of which pyXLWrtiter is a
docs-free port? Right down the end it mutters something about XML
parsers returning UTF8 which will jam up the works if fed into an Excel
spreadsheet ...




More information about the Python-list mailing list