From 4fde119362aeefb428ac1073f4e149dacc450a64 Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Sat, 13 Aug 2005 19:54:40 +0000 Subject: [PATCH] for consistency, display high-bit single-byte control characters as Unicode FFFD in UTF-8 mode git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2987 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 5 ++--- src/chars.c | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 097d2ad8..6d8c9b74 100644 --- a/ChangeLog +++ b/ChangeLog @@ -89,9 +89,8 @@ CVS code - history_reset(); changes to nanogetstr(). (DLR) - Various character-handling cleanups. If we get an invalid multibyte sequence, treat it as Unicode FFFD (Replacement - Character), unless we're determining if it's a control - character or searching for a match to it. Also, remove - unneeded variables and checks when parsing multibyte + Character), unless we're searching for a match to it. Also, + remove unneeded variables and checks when parsing multibyte sequences. Changes to is_alnum_mbchar(), is_blank_mbchar(), is_cntrl_mbchar(), is_punct_mbchar(), control_mbrep(), mbwidth(), make_mbchar(), parse_mbchar(), mbstrncasecmp(), diff --git a/src/chars.c b/src/chars.c index bb41f600..912b89fd 100644 --- a/src/chars.c +++ b/src/chars.c @@ -139,7 +139,7 @@ bool is_cntrl_mbchar(const char *c) if (mbtowc(&wc, c, MB_CUR_MAX) < 0) { mbtowc(NULL, NULL, 0); - wc = (unsigned char)*c; + wc = bad_wchar; } return is_cntrl_wchar(wc); -- 2.39.5