diff options
Diffstat (limited to 'console/display.c')
-rw-r--r-- | console/display.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/console/display.c b/console/display.c index 43e01e29..638ac222 100644 --- a/console/display.c +++ b/console/display.c @@ -1629,8 +1629,17 @@ display_output_some (display_t display, char **buffer, size_t *length) if (nconv == (size_t) -1) { - /* Conversion didn't work out. */ - if (saved_err == EINVAL) + /* Conversion is not completed, look for recoverable + errors. */ +#define UNICODE_REPLACEMENT_CHARACTER ((wchar_t) 0xfffd) + if (saved_err == EILSEQ) + { + assert (*length); + (*length)--; + (*buffer)++; + display_output_one (display, UNICODE_REPLACEMENT_CHARACTER); + } + else if (saved_err == EINVAL) /* This is only an unfinished byte sequence at the end of the input buffer. */ break; |