Skip to content

Conversation

SRombauts
Copy link
Owner

If the database is in a different format (ie. UTF-16) the memory that sqlite3_column_blob() will point to by default will be the native (UTF-16) encoding. Calling sqlite3_column_bytes() will basically be a noop for a BLOB or a TEXT already in UTF-8. Otherwise it'll convert to TEXT w/UTF-8.

Run the 'basis' tests against both a UTF-8 and a UTF-16 database. Reset & rerun query between tests blocks to reset column types. Reorder a few getText()/getString() operations to ensure we test both ordering. Don't try to convert random blob to TEXT. Will fail encoding conversion.

Extracted from #379 by @dougnazar

…blob()

If the database is in a different format (ie. UTF-16) the memory that
sqlite3_column_blob() will point to by default will be the native (UTF-16)
encoding. Calling sqlite3_column_bytes() will basically be a noop for
a BLOB or a TEXT already in UTF-8. Otherwise it'll convert to TEXT w/UTF-8.

Run the 'basis' tests against both a UTF-8 and a UTF-16 database.
Reset & rerun query between tests blocks to reset column types.
Reorder a few getText()/getString() operations to ensure we test both ordering.
Don't try to convert random blob to TEXT. Will fail encoding conversion.
@SRombauts SRombauts added the bug label Dec 11, 2022
@SRombauts SRombauts self-assigned this Dec 11, 2022
@SRombauts SRombauts merged commit c195cfe into master Dec 11, 2022
@SRombauts SRombauts deleted the fix-column-get-string-utf16 branch December 11, 2022 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants