Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnicodeDecodeError #29

Closed
andreasnuesslein opened this issue Nov 27, 2014 · 2 comments
Closed

UnicodeDecodeError #29

andreasnuesslein opened this issue Nov 27, 2014 · 2 comments

Comments

@andreasnuesslein
Copy link

I'm trying to write a django-pyodbc-informix driver.

I have the following problem:
ipdb> self.cursor.execute("SELECT DBINFO('sqlca.sqlerrd1') FROM SYSTABLES")
*** UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbb in position 1: invalid start byte

Also:
cursor.execute("SELECT FIRST 1 'x' FROM SYSTABLES")
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd5 in position 1: invalid continuation byte

But:
ipdb> self.cursor.execute('SELECT FIRST 1 * FROM SYSTABLES')
<pyodbc.Cursor object at 0x7fb3a973bdb0>

So apparently the ' is giving problems. =(

any help would be greatly appreciated

@andreasnuesslein
Copy link
Author

Oh and when I execute the same statement using python2.7, it works like a charm.

@andreasnuesslein
Copy link
Author

I've pinpointed the problem:
name seems to include invalid unicode-sequences @
https://github.com/mkleehammer/pyodbc/blob/master/src/cursor.cpp#L321
and @
https://github.com/mkleehammer/pyodbc/blob/master/src/cursor.cpp#L342

once i removed/replaced those two occurances, it worked. \o/ obviously it'd be better to fix the name. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants