postgresql - How to conserve the integrity of the string from a database response using Python -
i using py-postgresql driver database, when make select string non-ascii characters, response replace character "�" can make change correct character?
this 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 modules_reg, domain_reg, sbdomain_reg, sbdomdl_asc where(modules_reg.id = sbdomdl_asc.module , modules_reg.mdname = 'police' , sbdomain_reg.id = sbdomdl_asc.domain , sbdomain_reg.domain = domain_reg.id , domain_reg.dname = 'bmsuite.com' , sbdomain_reg.sbname = 'www')""") s = d() print(s) if __name__ == '__main__': decodify()
are setting client_encoding
? in theory py-postgresql should use correct client_encoding
automatically. either setting wrong, or there wrong on how detects it, in case have set it. question what. :)
Comments
Post a Comment