getting data with proper encoding to the finish

Ksenia Marasanova ksenia.marasanova at
Mon Mar 14 18:55:08 CET 2005


I have a little problem with encoding. Was hoping maybe anyone can
help me to solve it.

There is some amount of data in a database (PG) that must be inserted
into Excel sheet and emailed. Nothing special, everything works.
Except that non-ascii characters are not displayed properly.
The data is stored as XML into a text field. When I use pgsql it's
displayed good in the terminal. Now I run my script and print data
with "print" statement, still goed. Then I use pyXLWriter to write the
sheet, and Python email package to email it... and the resulting sheet
is not good:

Г is displayed instead of ü (for example)

The most important question that I'd like to ask, is what is the
proper way to debug it?! How can I determine where it goes wrong
(maybe by calculating character code or something?) I know very little
about how encoding works, I use it, but I don't really understand
it... any dummy-proof pointers are also appreciated :)



More information about the Python-list mailing list