Replace wstring_convert with the Win32 conversion functions - #308
Open
mnightingale wants to merge 2 commits into
Open
Replace wstring_convert with the Win32 conversion functions#308mnightingale wants to merge 2 commits into
mnightingale wants to merge 2 commits into
Conversation
mnightingale
force-pushed
the
libpar2/utf8-drop-codecvt
branch
from
August 31, 2026 20:22
b9026ea to
a799d0f
Compare
mnightingale
force-pushed
the
libpar2/utf8-drop-codecvt
branch
from
September 5, 2026 15:52
a799d0f to
957b1c8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
<codecvt>andstd::wstring_convertwere deprecated in C++17 and are removed in C++26, soutf8.cpphas to move off them eventually. This replaces them withMultiByteToWideChar/WideCharToMultiByte.MB_ERR_INVALID_CHARSandWC_ERR_INVALID_CHARSare not new strictness, they preserve the old behaviour.wstring_convertthrewstd::range_erroron ill-formed input and the code caught it; without those flags the replacement would silently substitute U+FFFD instead.The conversions now return
booland report failure to the caller rather than logging and returning an empty string.Two bugs fixed:
\\?\UNC\\server\shareWideToUtf8ArgsAdaptermishandled a null inwargv:--m_argc; --i; continue;re-examines the same index while shrinking the count, so one null argument dropped every argumentutf8.{h,cpp}is now#ifdef _WIN32, since it is Win32-only; the unit test exits 77 (SKIP) elsewhere.