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
charset conversion error for sql (VAR)CHAR to SQL_C_WCHAR conversion [ODBC181] #170
Comments
Commented by: Jojakim Stahl (jstahl) uploaded patch |
Modified by: Jojakim Stahl (jstahl)Attachment: bug-181.patch [ 12613 ] |
Commented by: Guy Dion (gdfbu) I had the following problem: SELECT LOWER('ÉÈËïÎÀÖÙÛÇ') FROM RDB$DATABASE correctly returned 'çöùûàéèëïî' with JayBird JDBC driver but returned a truncated string 'çöùûà' using ODBC driver 2.0.3 or 2.0.4 (see issue ODBC184). I have applied this patch (to the trunk version obtained here http://firebird.cvs.sourceforge.net/viewvc/firebird/OdbcJdbc/) and recompiled using Ms Visual Studio 2013. It has corrected the problem. Tested with both 32 bits and 64 bits ODBC connection under Windows 7 64 bits. |
Commented by: @alexpotapchenko Jojakim, can you send final version of OdbcConvert.cpp (OdbcDesc.cpp, IscStatementMetaData.cpp etc.) with all applied patches (160, 161, 162, 180 etc.)? |
Commented by: Jojakim Stahl (jstahl) Hello, I attached the sources which I currently use to build my "own/private" version of the driver which I am using with our application. The sources are base on cvs head from 2015-02-25. |
Modified by: Jojakim Stahl (jstahl)Attachment: FbOdbc.zip [ 12982 ] |
Commented by: @alexpotapchenko Jojakim, thanks. I think your changes will be included to ODBC driver 2.1 (cvs head now). |
Commented by: @alexpotapchenko Fixed in CVS |
Modified by: @alexpotapchenkostatus: Open [ 1 ] => Resolved [ 5 ] resolution: Fixed [ 1 ] Fix Version: 2.0.5 [ 10771 ] Fix Version: 2.1 Beta [ 10410 ] |
Modified by: @alexpotapchenkostatus: Resolved [ 5 ] => Closed [ 6 ] |
Submitted by: Jojakim Stahl (jstahl)
Attachments:
bug-181.patch
FbOdbc.zip
Votes: 1
The charset conversion from db cp encoded string to SQL_C_WCHAR (wide char string) mixes up length Information etc.
It's based on the assumption 1 Byte in db cp = 2 Byte in wide notation. This relationship is not valid. For UTF8 1-4 bytes may result in 1 or 2 wide chars = 2 or 4 bytes.
Commits: 9fca7df d94a113
The text was updated successfully, but these errors were encountered: