utf8conv is a lightweight utility for converting between wide-character strings (std::wstring or wchar_t*) and standard strings (std::string or char*) encoded as UTF-8, without relying on system locales.
It is designed for environments where consistent, locale-independent string handling is critical—such as embedded systems or any context where locale setup is unreliable or unavailable.
- Supports only UTF-8 encoded strings
- Assumes that only Windows uses UTF-16 encoded
wchar_t - All other platforms are treated as using UTF-32 encoded
wchar_t - Does not depend on system locales
- Replaces invalid sequences with
?
- Header-only (
.hpp) for C++ projects - Compatible
.h/.cimplementation for pure C projects