-
Notifications
You must be signed in to change notification settings - Fork 562
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
Add SQL_WCHART_CONVERT for UnixODBC. #20
Conversation
…y fails otherwise, on Ubuntu 64 i686. This is not final code, I will package it better once I hear about other configurations.
Thanks so much. Take a look at the "u4" branch and see if it works for you: https://github.com/mkleehammer/pyodbc/tree/u4 To make sure it is only enabled when Unicode is 4-bytes, I've used the array class to specifically look at the Unicode character size. I then enable it using define_macros but only in the Linux / Unix area. I wasn't exactly sure what to do with the test code and I don't have Virtuoso right now, but it would be great to setup a unit test file for it. In the meantime, can you test the u4 branch against your install? Thanks again, |
Hello I am testing this driver with Vertica (with last commit ddcaaed) and I have no success with simply strings:
Result:
I table bubu:
I hope so ODBC unixODBC-2.2.14-12.el6_3.x86_64 is ok (isql shows correct result). |
Thank you very much for the data point. Le 2013-10-15 à 06:12, Pavel Stehule notifications@github.com a écrit :
|
It is varchar - Vertica doesn't supports nvarchars - if I understand, it use UTF8 Yes, my environment is 64bit - RHEL. gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPYODBC_VERSION=3.0.8-beta06 -DPYODBC_UNICODE_WIDTH=4 -DSQL_WCHART_CONVERT=1 -I/usr/include/python2.6 -c /root/pyodbc/src/pyodbcdbg.cpp -o build/temp.linux-x86_64-2.6/root/pyodbc/src/pyodbcdbg.o -Wno-write-strings |
Now that I look at this again I'm not sure it is a good idea. The unixODBC authors discourage changing flags like using wchar_t size, etc. Can you try 3.0.10 and see if it helps. A better solution might be to allow an encoding to be set on a connection such as UTF8. I also might be able to optimize it a bit in Python 3.4+ where we might actually have 1-byte strings internally. |
I have rewritten Unicode support in the v4 branch. |
The simple test in testunicode.py fails otherwise, on Ubuntu 64 i686, with a 64 bit driver. (Virtuoso)
This is not yet final code, I will package it better once I hear confirmation that it does not break other configurations, or create tests otherwise.
I'm sending it as a pull request in this state to raise the issue.