Unicode error with ado in win 32

Fredrik Lundh fredrik at pythonware.com
Wed Feb 21 14:17:35 EST 2001

Keanu wrote:
> It work properly but when into the rs.fields('azienda') theres the string
> "abbà" the script returns the following message.

>   File "G:\Programmi\Python20\fede.py", line 12, in ?
>     print unicode(a)

try one of:

    # always works, but may not look right
    print a.encode("utf-8")

    # replace non-ascii with "?"
    print a.encode("ascii", "replace")

    # skip non-ascii characters
    print a.encode("ascii", "ignore")

    # latin-1 (western europe)
    print a.encode("latin-1", "replace")

Cheers /F

<!-- (the eff-bot guide to) the standard python library:

More information about the Python-list mailing list