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

Add portable lenient UTF-8/16 conversion routines #70

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

staticlibs
Copy link
Contributor

This change add support for lenient UTF-16 to/from UTF-8 conversion routines. It is implemented using UTF8-CPP library. The intention is to use these routines in the implementation of #69.

Testing: tests added covering conversion routines and addtional helper functions not provided by UTF8-CPP.

@staticlibs
Copy link
Contributor Author

staticlibs commented Mar 4, 2025

@maiadegraaf

I decided to split the implementation of UTF conversion utilities and SQLDriverConnectW (and other *W functions for #69) into separate PRs.

UTF8-CPP was chosen after investigating various variants from this article.

Also, despite the ODBC spec only officially supports UCS-2 (BMP only, no surrogates), the conversion functions expect UTF-16 because client applications may not obey the UCS-2-only requirement.

edit: removed open questions, should be all covered in the cleaned-up updated version.

@staticlibs staticlibs force-pushed the widechar_conversion_routines branch 3 times, most recently from 0852c35 to 6a9f756 Compare March 8, 2025 23:47
This change add support for lenient UTF-16 to/from UTF-8 conversion
routines. It is implemented using UTF8-CPP library. The intention is to
use these routines in the implementation of duckdb#69.

Testing: tests added covering conversion routines and addtional helper
functions.
@staticlibs staticlibs force-pushed the widechar_conversion_routines branch from 6a9f756 to 01bb3f4 Compare March 8, 2025 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant