diff --git a/src/boxes.c b/src/boxes.c index 43c80b7c5..2026ad865 100644 --- a/src/boxes.c +++ b/src/boxes.c @@ -569,7 +569,8 @@ sel_charset_button (int action) cpname = (new_display_codepage < 0) ? _("Other 8 bit") : codepages[new_display_codepage].name; - + if ( cpname ) + utf8_display = str_isutf8 (cpname); /* avoid strange bug with label repainting */ g_snprintf (buf, sizeof (buf), "%-27s", cpname); label_set_text (cplabel, buf); diff --git a/src/main.c b/src/main.c index d9b6d783d..55ccc316c 100644 --- a/src/main.c +++ b/src/main.c @@ -152,8 +152,16 @@ int eight_bit_clean = 1; * This is reported to break on many terminals (xterm, qansi-m). */ int full_eight_bits = 0; + #endif /* !HAVE_CHARSET */ +/* + * If utf-8 terminal utf8_display = 1 + * Display bits set UTF-8 + * +*/ +int utf8_display = 0; + /* If true use the internal viewer */ int use_internal_view = 1; diff --git a/src/main.h b/src/main.h index d858cb2ee..3895f4583 100644 --- a/src/main.h +++ b/src/main.h @@ -50,6 +50,7 @@ struct edit_stack_type edit_history_moveto[MAX_HISTORY_MOVETO]; #ifdef HAVE_CHARSET extern int source_codepage; extern int display_codepage; +extern int utf8_display; #else extern int eight_bit_clean; extern int full_eight_bits; diff --git a/src/setup.c b/src/setup.c index a5426faa3..d50e3723c 100644 --- a/src/setup.c +++ b/src/setup.c @@ -59,6 +59,8 @@ # include "../edit/edit.h" #endif +#include "../src/strutil.h" /* str_isutf8 () */ + extern char *find_ignore_dirs; @@ -589,6 +591,8 @@ load_setup (void) source_codepage = get_codepage_index( cpname ); } init_translation_table( source_codepage, display_codepage ); + if ( get_codepage_id( display_codepage ) ) + utf8_display = str_isutf8 (get_codepage_id( display_codepage )); #endif /* HAVE_CHARSET */ }