Commit d322258
Fix for Uint8 / Uint16 Unicode string (#220)
* Fix truncated string when underlying database engine do not use Uint8 unicode data format.
* Update for full unicode specification.
Usage of field size is deleted, only data size remain to determine the
length of data we need to read.
This fix the bug that cause the driver to truncate string if the above
two conditions are verified :
- the underlying database engine use Uint16 in place of Uint8 for
encoding unicode string.
- the readed string size in greater than the half of the field size.
Example for Uint16 encoding :
- field size 10, string size 4 -> no bug
- field size 10, string size 6 -> bug, only the firsts fives characters
are returned
According to MS Doc The function SQLDescribeCol, return among other
things, the size in characters, not byte, of the field.
the other ODBC functions used to retrieve data use length indicator
in byte. (SQLBindCol, SQLFetchScroll)
Another bug may be corrected when using Uint8 and many 3-bytes
unicode characters. ! TO BE TESTED !
* Update test case for unicode char
* Update for correct offset calculation
* Delete test.jl
Delete personal test file
* add @inbound1 parent a0cc3e5 commit d322258
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
210 | | - | |
| 210 | + | |
211 | 211 | | |
212 | | - | |
| 212 | + | |
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
| |||
0 commit comments