diff --git a/src/output.cpp b/src/output.cpp index e1bcd7cdb..19c3533bb 100644 --- a/src/output.cpp +++ b/src/output.cpp @@ -402,6 +402,11 @@ int outputter_t::writech(wint_t ch) { void outputter_t::writestr(const wchar_t *str) { assert(str && "Empty input string"); + if (MB_CUR_MAX == 1) { + // Single-byte locale (C/POSIX/ISO-8859). + while (*str) writech(*str++); + return; + } size_t len = wcstombs(nullptr, str, 0); // figure amount of space needed if (len == static_cast(-1)) { debug(3, L"Tried to print invalid wide character string");