Add support for C++ Unicode types
Add support for using char8_t, char16_t, wchar_t, u8string, u16string & wstring when available. wchar_t & wstring support are only available on platforms with a 2 byte wchar_t.
Usable to create Statements, bind parameters and retrieve column data.
The first commit is a fix for when the native database is in UTF-16 format and you try to extract a std::string.
Hey hello @dougnazar, I have merged only the first of your commits, the bugfix & unit tests, in order to release a 3.2.1 bugfix release ASAP without changes to APIs Thanks
@dougnazar what about char32_t and u32string? I'm using it al lot in asian language tools. Are you planning to create new PR with it or I'll do it instead when all your commits will be merged. @SRombauts when are you planning to merge at least bind-related commits? I believe it's very useful feature.
Unfortunately SQLite doesn't natively support UTF-32, so there is no API to pass through to. They've recently added sqlite3_bind_text64() however it only accepts SQLITE_UTF8, SQLITE_UTF16, SQLITE_UTF16BE, or SQLITE_UTF16LE.
I'm not sure that SQLiteC++ is the correct layer to handle the conversion. It would add a hidden performance cost for using that API.
Unfortunately SQLite doesn't natively support UTF-32, so there is no API to pass through to. They've recently added
sqlite3_bind_text64()however it only acceptsSQLITE_UTF8,SQLITE_UTF16,SQLITE_UTF16BE, orSQLITE_UTF16LE.I'm not sure that SQLiteC++ is the correct layer to handle the conversion. It would add a hidden performance cost for using that API.
I agree, will stick to external 32-16 conversion until it's natively supported. Thank you for your enhancements!