How to conserve the integrity of the string from a database response using Python

Hidura hidura at
Fri Feb 18 05:19:55 CET 2011

Hello, i am using py-postgresql as the driver the database, when make a
select to a string with non-ASCII characters, the response replace the
character with "�" what can i make to change this to the correct character?

This is my code:

<code>class decodify:

    def __init__(self):
        db = pgDriver.connect(user = 'demo', password='demo'
database='hidura_karinapp', host='localhost', port='5432')
        d = db.prepare("""SELECT modules_reg.code FROM modules_reg,
domain_reg, sbdomain_reg, sbdomdl_asc where( =
sbdomdl_asc.module AND modules_reg.mdname = 'police' AND =
sbdomdl_asc.domain AND sbdomain_reg.domain = AND
domain_reg.dname = '' AND sbdomain_reg.sbname = 'www')""")
        s = d()

if __name__ == '__main__':

Diego I. Hidalgo D.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list