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

charset conversion error for sql (VAR)CHAR to SQL_C_WCHAR conversion [ODBC181] #170

Closed
firebird-automations opened this issue Nov 3, 2014 · 10 comments

Comments

@firebird-automations
Copy link

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

@firebird-automations
Copy link
Author

Commented by: Jojakim Stahl (jstahl)

uploaded patch

@firebird-automations
Copy link
Author

Modified by: Jojakim Stahl (jstahl)

Attachment: bug-181.patch [ 12613 ]

@firebird-automations
Copy link
Author

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.

@firebird-automations
Copy link
Author

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.)?
Some your patches does not apply by turn.

@firebird-automations
Copy link
Author

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.
Nice that you are going to integrate the fixes, perhaps I can abandon my fork then.
Greetings

@firebird-automations
Copy link
Author

Modified by: Jojakim Stahl (jstahl)

Attachment: FbOdbc.zip [ 12982 ]

@firebird-automations
Copy link
Author

Commented by: @alexpotapchenko

Jojakim, thanks. I think your changes will be included to ODBC driver 2.1 (cvs head now).

@firebird-automations
Copy link
Author

Commented by: @alexpotapchenko

Fixed in CVS

@firebird-automations
Copy link
Author

Modified by: @alexpotapchenko

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 2.0.5 [ 10771 ]

Fix Version: 2.1 Beta [ 10410 ]

@firebird-automations
Copy link
Author

Modified by: @alexpotapchenko

status: Resolved [ 5 ] => Closed [ 6 ]

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

No branches or pull requests

2 participants