Skip to content

Fix rendering of replacement_char when Charset_is_utf8

The line to draw the replacement char in pager.c was addch (replacement_char ()). However, if Charset_is_utf8 is true, replacement_char returns 0xfffd, which is outside the range that addch can handle. The curses version I use ignores in that case the background color I configured, leading to black blocks in the pager display. The fix is straightforward: Use mutt_addwch instead.

I have lost the email where the issue originally occurred and couldn't find another one with invalid utf8 characters, so I couldn't test this fix properly. If I remember correctly, this is exactly how I fixed the issue back then; I just didn't create a merge request.

Merge request reports