Unicode error with ado in win 32

Fredrik Lundh fredrik at pythonware.com
Wed Feb 21 20:17:35 CET 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:
http://www.pythonware.com/people/fredrik/librarybook.htm
-->






More information about the Python-list mailing list