Issue Details (XML | Word | Printable)

Key: ODBC-181
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Alexander Potapchenko
Reporter: Jojakim Stahl
Votes: 1
Watchers: 1

If you were logged in you would be able to see more operations.
ODBC Driver

charset conversion error for sql (VAR)CHAR to SQL_C_WCHAR conversion

Created: 03/Nov/14 12:48 PM   Updated: 18/Jul/17 11:05 AM
Component/s: None
Affects Version/s: 2.0.2
Fix Version/s: 2.0.5, 2.1 Beta

File Attachments: 1. Text File bug-181.patch (8 kB)
2. Zip Archive (1.65 MB)

Environment: Win32/Fb2.5

 Description  « Hide
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.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Jojakim Stahl added a comment - 03/Nov/14 01:16 PM
uploaded patch

Guy Dion added a comment - 17/Jun/15 08:37 PM
I had the following problem:


correctly returned 'çöùûàéèëïî' with JayBird JDBC driver but returned a truncated string 'çöùûà' using ODBC driver 2.0.3 or 2.0.4 (see issue ODBC-184).

I have applied this patch (to the trunk version obtained here 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.

Alexander Potapchenko added a comment - 05/Jul/16 12:16 PM
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.

Jojakim Stahl added a comment - 06/Jul/16 07:45 AM
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.

Alexander Potapchenko added a comment - 06/Jul/16 09:38 AM
Jojakim, thanks. I think your changes will be included to ODBC driver 2.1 (cvs head now).

Alexander Potapchenko added a comment - 02/Jan/17 01:20 PM
Fixed in CVS