Subject Re: [firebird-python] sqlalchemy ticket 2125
Author Philippe Makowski
werner [2011-07-18 19:00] :
> What are the particular problems you are running into?
>
handling correctly unicode
for now

> Would be a pity, I thought Hajime had made all the necessary changes to
> be able to have it compatible for both Py2 and Py3.
not yet
run this for example, and you'll see :

# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
# vim: set fileencoding=utf-8 :
# -*- coding: utf-8 -*-
import firebirdsql

TEST_DSN = 'localhost:/tmp/tmp.fdb'
TEST_USER = 'sysdba'
TEST_PASS = 'masterkey'
conn = firebirdsql.create_database(TEST_DSN, TEST_USER, TEST_PASS,
port=3050)

cur = conn.cursor()
cur.execute("select cast('A' as varchar(1)) from rdb$database")
for c in cur.fetchall():
print(c)
cur = conn.cursor()
cur.execute("select 'é à' from rdb$database")
for c in cur.fetchall():
print(c)
cur = conn.cursor()
cur.execute("select cast('À' as char(3) character set UTF8) from
rdb$database")
for c in cur.fetchall():
print(c)
cur = conn.cursor()
cur.execute("select cast('À ' as char(3) character set ISO8859_1) from
rdb$database")
for c in cur.fetchall():
print(c)
cur = conn.cursor()
cur.execute("select cast('À' as char(1) character set UNICODE_FSS),
cast('À' as char(1) character set UTF8) from rdb$database")
for c in cur.fetchall():
print(c)