You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2dd7c5b
Browse filesBrowse the repository at this point in the historyBrowse files
Rename Utf8 to Unicode and address review findings (#25)
Review follow-up on the non-BMP conversion fix. Behavior is unchanged
apart from one error message and the two documentation corrections.
- Rename Utf8 to Unicode, since the class also carries the UTF-16
conversions, and give all four methods one naming shape:
Utf8FromCodePoints, CodePointsFromUtf8, Utf16FromCodePoints,
CodePointsFromUtf16. Files and test suites renamed to match.
- Collapse the four duplicated element-wise cast loops in the WideCodec
specializations into a single cast_each helper.
- static_assert the supported wchar_t widths, so an unsupported width
reports a portability limit rather than an incomplete type inside a
typedef.
- Rename reject to throw_invalid_unicode and mark it [[noreturn]], so
call sites read as terminating without consulting the callee.
- Derive the surrogate range from the UTF-16 bounds instead of repeating
D800/DFFF as a second pair of constants at char32_t width.
- Name CESU-8 as the likely cause in the decode error, and document that
text written by a pre-fix build where wchar_t is 16 bits no longer
reads back. That data was stored ill-formed; because encoding and
decoding were wrong in the same way, it only surfaces now.
- Correct the README throw guarantee to TEXT values: a BLOB in a
MEMBER_TEXT column is skipped like NULL and never decoded. Also note
the one platform difference that survives, that wstring counts code
units, so L"\U0001F600".size() is 2 where wchar_t is 16 bits and 1
where it is 32.
Verified on macOS Clang at C++11 and C++20: 124/124 tests pass in both,
clang-format clean on the changed files.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
0 commit comments