diff --git a/src/chars.c b/src/chars.c index 99554551..cde5a808 100644 --- a/src/chars.c +++ b/src/chars.c @@ -286,7 +286,7 @@ int collect_char(const char *string, char *thechar) int advance_over(const char *string, size_t *column) { #ifdef ENABLE_UTF8 - if ((unsigned char)*string > 0xC1) { + if ((signed char)*string < 0) { int charlen = mblen(string, MAXCHARLEN); if (charlen > 0) { @@ -310,8 +310,10 @@ int advance_over(const char *string, size_t *column) *column += 2; } else if (*string == 0x7F) *column += 2; - else if (!use_utf8 && 0x7F < (unsigned char)*string && (unsigned char)*string < 0xA0) +#ifndef ENABLE_UTF8 + else if (0x7F < (unsigned char)*string && (unsigned char)*string < 0xA0) *column += 2; +#endif else *column += 1; diff --git a/src/winio.c b/src/winio.c index b26db1be..1c05ad7a 100644 --- a/src/winio.c +++ b/src/winio.c @@ -2075,7 +2075,9 @@ void minibar(void) size_t namewidth, placewidth; size_t tallywidth = 0; size_t padding = 2; +#ifdef ENABLE_UTF8 wchar_t widecode; +#endif /* Draw a colored bar over the full width of the screen. */ wattron(bottomwin, interface_color_pair[TITLE_BAR]); @@ -2139,7 +2141,10 @@ void minibar(void) if (*this_position == '\0') sprintf(hexadecimal, openfile->current->next ? - (using_utf8() ? "U+000A" : " 0x0A") : " ----"); +#ifdef ENABLE_UTF8 + using_utf8() ? "U+000A" : +#endif + " 0x0A" : " ----"); else if (*this_position == '\n') sprintf(hexadecimal, " 0x00"); #ifdef ENABLE_UTF8