Nominal support for wide char params binding #68
+2
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Edit: up to date description:
This change adds only a nominal support for passing query parameters
as
SQL_WVARCHAR
, it uses existing logic that is already there forSQL_WCHAR
parameters.It allows to use parameters from PyODBC, but in current impl only ASCII
data can be passed in these parameters.
Testing: none, test suite needs to be extended to test unicode through
the driver manager (related issue - #69).
Original description (encoding conversion removed in PR update):
Before this change the binding for
SQL_WCHAR
parameters was declared inParameterDescriptor::SetValue
but was not actually implemented (no encoding conversion).This change implements support for getting incoming
SQL_WCHAR
/SQL_WVARCHAR
parameters as normal UTF-8 values. Incoming UCS-2 (on Windows) or UTF-32 (on other platforms) parameter data is converted to UTF-8 using C++ stdlib.Testing: added a test that inserts non-ASCII data as literal and then uses wide char parameter binding to match this data in
SELECT
.Fixes: #49