Coder Social home page Coder Social logo

Comments (21)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
Worth noting that this works fine with pyodbc

Original comment by [email protected] on 1 Apr 2013 at 9:05

from pypyodbc.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
Same result with latest from Git.

Original comment by [email protected] on 1 Apr 2013 at 10:25

from pypyodbc.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
Can you provide additional information, such as 64bit , 32bit information ?

Original comment by [email protected] on 1 Apr 2013 at 10:50

from pypyodbc.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
Yep, 64bit CentOS 6.1 with 64-bit Python 2.7.2.

Original comment by [email protected] on 1 Apr 2013 at 10:52

from pypyodbc.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
Also tried with 64-bit CentOS 6.3, RHEL 6.1 and Python 3.2.3.  All give the 
same error.

Original comment by [email protected] on 1 Apr 2013 at 11:21

from pypyodbc.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
[deleted comment]

from pypyodbc.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
Can you check what would be the output if you add ansi=False?
conn = pypyodbc.connect('DRIVER={MySQL ODBC 5.1 
Driver};SERVER=myserver;DATABASE=mydb;UID=user;PWD=password',ansi=False,ansi=Fal
se,unicode_results=Fase)

Original comment by [email protected] on 1 Apr 2013 at 12:02

from pypyodbc.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
Do you mean ansi=True?  False is default.  If I do =True, it connects ok, but 
then all my results come back encoded like:

u'\udc80\udc75\udc40\udc65'

Original comment by [email protected] on 1 Apr 2013 at 12:02

from pypyodbc.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
conn = pypyodbc.connect('DRIVER={MySQL ODBC 5.1 
Driver};SERVER=myserver;DATABASE=mydb;UID=user;PWD=password',ansi=False,unicode_
results=False)

Gives me the same error...

conn = pypyodbc.connect('DRIVER={MySQL ODBC 5.1 
Driver};SERVER=myserver;DATABASE=mydb;UID=user;PWD=password',ansi=True,unicode_r
esults=False)

Still gives me unicode results.

Original comment by [email protected] on 1 Apr 2013 at 12:05

from pypyodbc.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
[deleted comment]

from pypyodbc.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
And if you try and print one of the unicode results:

UnicodeEncodeError: 'latin-1' codec can't encode characters in position 0-3: 
ordinal not in range(256)

Original comment by [email protected] on 1 Apr 2013 at 12:39

from pypyodbc.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
I will install a CentOS 64bit and try that.

Original comment by [email protected] on 1 Apr 2013 at 12:59

from pypyodbc.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
Thanks!  Just so you get the same setup:

$ odbcinst --version
unixODBC 2.3.0

$ cat /etc/odbcinst.ini
[PostgreSQL]
Description=ODBC for PostgreSQL
Driver=/usr/lib/libodbcpsql.so
FileUsage=1

[SQL Server Native Client 11.0]
Description=Microsoft SQL Server ODBC Driver V1.0 for Linux
Driver=/opt/microsoft/sqlncli/lib64/libsqlncli-11.0.so.1790.0
Threading=1
UsageCount=1

[MySQL ODBC 5.1 Driver]
Driver=/usr/lib64/libmyodbc5.so
UsageCount=2

Original comment by [email protected] on 1 Apr 2013 at 1:57

from pypyodbc.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
It works fine on my Ubuntu box at home, so might well be a CentOS / RHEL issue.

Original comment by [email protected] on 1 Apr 2013 at 8:10

from pypyodbc.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
is your ubuntu at home 64 bit?

Original comment by [email protected] on 1 Apr 2013 at 11:18

from pypyodbc.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
Yes

Original comment by [email protected] on 2 Apr 2013 at 6:21

from pypyodbc.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
Hi, Finally I'm not able to setup CentOS, so I would like to suggest two quick 
changes you can have a try.


First step:
-Open pypyodbc.py, text replace "if status == 0 and 'SQL_WCHART_CONVERT' in 
output:" to "if True:" .This will only make one change in Line 479.

Have a try.

Second step:
-If that doesn't work, text replace all "utf_16" to "utf_32" and all 
"utf_16_le" to "utf_32"

And then try again.

Hope that works.

Original comment by [email protected] on 2 Apr 2013 at 12:10

from pypyodbc.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
The fist test results in:
>>> import pypyodbc
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/scratch/Python/lib/python2.7/site-packages/pypyodbc.py", line 518, in <module>
    raise OdbcLibraryError('Using narrow Python build with ODBC library '
pypyodbc.OdbcLibraryError: 'Using narrow Python build with ODBC library 
expecting wide unicode is not supported.'

And the second (with or without the first) results in the same issue as before.

Original comment by [email protected] on 2 Apr 2013 at 12:59

from pypyodbc.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
This works fine on the same box with 3.3.1, so it could be an issue with 2.7.2.

Original comment by [email protected] on 15 May 2013 at 1:18

from pypyodbc.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
2.7.4 has the same issue

Original comment by [email protected] on 15 May 2013 at 1:39

from pypyodbc.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024

Original comment by [email protected] on 3 Sep 2013 at 11:35

  • Changed state: Duplicate

from pypyodbc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.