From 98696aa91c67127398955fc614a112b67bf9a5cd Mon Sep 17 00:00:00 2001 From: John Zaitseff Date: Fri, 24 Aug 2018 13:32:32 +1000 Subject: [PATCH] Use the wide-character version of EILSEQ_REPL --- src/utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils.c b/src/utils.c index d082a42..c8361bb 100644 --- a/src/utils.c +++ b/src/utils.c @@ -645,10 +645,10 @@ ssize_t xwcsfmon (wchar_t *restrict buf, size_t maxsize, on locales such as ru_RU.UTF-8 which use U+00A0 NO-BREAK SPACE for mon_thousands_sep (stored in UTF-8 as 0xC2 0xA0. As a result, incomplete character sequences are copied, which are - translated to EILSEQ_REPL characters by xmbstowcs() above. + translated to EILSEQ_REPL_WC characters by xmbstowcs() above. Fix such characters by replacing them with a space. */ for (wchar_t *p = buf; *p != L'\0'; p++) { - if (*p == EILSEQ_REPL) { + if (*p == EILSEQ_REPL_WC) { *p = L' '; } }