본문 바로가기

나만의 작은 공간/툴

virtuoso python encoding

For Python 3, try this:

After conn = pyodbc.connect(DSN='datbase',ansi=True,autocommit=True)

 

conn.setdecoding(pyodbc.SQL_CHAR, encoding='utf8') conn.setdecoding(pyodbc.SQL_WCHAR, encoding='utf8')        

conn.setencoding(encoding='utf8')

with conn.cursor() as cursor:

       cursor.execute("sparql select * where { graph <http://lod.work.go.kr> { ?s ?p ?o . } } limit 10 ")
rows = cursor.fetchall()

for row in rows:

      print(row)

conn.commit()
conn.close()