M
Marc Muehlfeld
Hi,
I'm doing my first steps with python and I have a problem with understanding
an encoding problem I have. My script:
import os
os.environ["NLS_LANG"] = "German_Germany.UTF8"
import cx_Oracle
connection = cx_Oracle.Connection("username/password@SID")
cursor = connection.cursor()
cursor.execute("SELECT NAME1 FROM COR WHERE CORNB='ABCDEF'")
TEST = cursor.fetchone()
print TEST[0]
print TEST
When I run this script It prints me:
München
('M\xc3\xbcnchen',)
Why is the Umlaut of TEST[0] printed and not from TEST?
And why are both prints show the wrong encoding, when I switch "fetchone()" to
"fetchall()":
('M\xc3\xbcnchen',)
[('M\xc3\xbcnchen',)]
I'm running Python 2.4.3 on CentOS 5.
Regards,
Marc
I'm doing my first steps with python and I have a problem with understanding
an encoding problem I have. My script:
import os
os.environ["NLS_LANG"] = "German_Germany.UTF8"
import cx_Oracle
connection = cx_Oracle.Connection("username/password@SID")
cursor = connection.cursor()
cursor.execute("SELECT NAME1 FROM COR WHERE CORNB='ABCDEF'")
TEST = cursor.fetchone()
print TEST[0]
print TEST
When I run this script It prints me:
München
('M\xc3\xbcnchen',)
Why is the Umlaut of TEST[0] printed and not from TEST?
And why are both prints show the wrong encoding, when I switch "fetchone()" to
"fetchall()":
('M\xc3\xbcnchen',)
[('M\xc3\xbcnchen',)]
I'm running Python 2.4.3 on CentOS 5.
Regards,
Marc