From e7372d18a1a661d8c3dba9f51e1f17b5f94171a7 Mon Sep 17 00:00:00 2001 From: Daniel Lange Date: Wed, 10 Jan 2024 11:17:08 +0100 Subject: New upstream version 3.3.0 --- RichString.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'RichString.c') diff --git a/RichString.c b/RichString.c index 3dac083..ed852ad 100644 --- a/RichString.c +++ b/RichString.c @@ -5,6 +5,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "RichString.h" #include @@ -61,7 +63,7 @@ static inline int RichString_writeFromWide(RichString* this, int attrs, const ch int newLen = from + len; RichString_setLen(this, newLen); for (int i = from, j = 0; i < newLen; i++, j++) { - this->chptr[i] = (CharType) { .attr = attrs & 0xffffff, .chars = { (iswprint(data[j]) ? data[j] : '?') } }; + this->chptr[i] = (CharType) { .attr = attrs & 0xffffff, .chars = { (iswprint(data[j]) ? data[j] : L'\xFFFD') } }; } return len; @@ -79,7 +81,7 @@ int RichString_appendnWideColumns(RichString* this, int attrs, const char* data_ int columnsWritten = 0; int pos = from; for (int j = 0; j < len; j++) { - wchar_t c = iswprint(data[j]) ? data[j] : '?'; + wchar_t c = iswprint(data[j]) ? data[j] : L'\xFFFD'; int cwidth = wcwidth(c); if (cwidth > *columns) break; @@ -101,7 +103,7 @@ static inline int RichString_writeFromAscii(RichString* this, int attrs, const c int newLen = from + len; RichString_setLen(this, newLen); for (int i = from, j = 0; i < newLen; i++, j++) { - this->chptr[i] = (CharType) { .attr = attrs & 0xffffff, .chars = { (isprint(data[j]) ? data[j] : '?') } }; + this->chptr[i] = (CharType) { .attr = attrs & 0xffffff, .chars = { (isprint(data[j]) ? data[j] : L'\xFFFD') } }; } return len; -- cgit v1.2.3