mx odbc result strings with special characters?

Fredrik Lundh fredrik at pythonware.com
Sun Mar 3 14:32:03 EST 2002


Alexander Jerusalem wrote:

> Ok, thanks for your reply. Here's my output:
>
> >>> import mx.ODBC.Windows as odbc
> >>> con = odbc.connect("se", "scienceexile", "x")
> >>> c = con.cursor()
> >>> c.execute("select * from country")
> >>> print c.fetchone()
> ('aa1', '\xd6sterreich-Ungarn', None, None)
> >>> c.close()
> >>> con.close()
>
> And it's the same when I write the resultset to a file, so I don't
> believe that it's just a display problem.

on the other hand:

>>> print '\xd6sterreich-Ungarn'
Österreich-Ungarn

more info here:

    http://www.python.org/doc/current/tut/node5.html

    "The interpreter prints the result of string operations in the
    same way as they are typed for input: inside quotes, and
    with quotes and other funny characters escaped by back-
    slashes, to show the precise value"

    http://www.python.org/doc/current/ref/strings.html
    http://www.python.org/doc/current/ref/exprstmts.html
    http://www.python.org/doc/current/ref/print.html
    (etc)

</F>

<!-- (the eff-bot guide to) the python standard library:
http://www.pythonware.com/people/fredrik/librarybook.htm
-->





More information about the Python-list mailing list