From ad669a3f0fd19ca590a157b486f84eedac334f7e Mon Sep 17 00:00:00 2001 From: Kalle Olavi Niemitalo Date: Sun, 20 May 2007 13:50:47 +0300 Subject: [PATCH] Bug 914: Add terminal.utf8_cp, not yet read. --- src/terminal/event.c | 6 ++++-- src/terminal/screen.c | 2 ++ src/terminal/terminal.h | 3 +++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/terminal/event.c b/src/terminal/event.c index 237ff5b20..2b715e07b 100644 --- a/src/terminal/event.c +++ b/src/terminal/event.c @@ -182,11 +182,13 @@ check_terminal_name(struct terminal *term, struct terminal_info *info) /* Probably not best place for set this. But now we finally have * term->spec and term->utf8 should be set before decode session info. * --Scrool */ + term->utf8_cp = is_cp_utf8(get_opt_codepage_tree(term->spec, + "charset")); /* Force UTF-8 I/O if the UTF-8 charset is selected. Various * places assume that the terminal's charset is unibyte if * UTF-8 I/O is disabled. (bug 827) */ - term->utf8 = get_opt_bool_tree(term->spec, "utf_8_io") - || is_cp_utf8(get_opt_codepage_tree(term->spec, "charset")); + term->utf8 = term->utf8_cp + || get_opt_bool_tree(term->spec, "utf_8_io"); #endif /* CONFIG_UTF8 */ } diff --git a/src/terminal/screen.c b/src/terminal/screen.c index 6e94ff62b..03708c25e 100644 --- a/src/terminal/screen.c +++ b/src/terminal/screen.c @@ -360,6 +360,7 @@ add_screen_driver(enum term_mode_type type, struct terminal *term, int env_len) #ifdef CONFIG_UTF8 term->utf8 = use_utf8_io(driver); + term->utf8_cp = driver->opt.utf8_cp; #endif /* CONFIG_UTF8 */ return driver; @@ -382,6 +383,7 @@ get_screen_driver(struct terminal *term) #ifdef CONFIG_UTF8 term->utf8 = use_utf8_io(driver); + term->utf8_cp = driver->opt.utf8_cp; #endif /* CONFIG_UTF8 */ return driver; } diff --git a/src/terminal/terminal.h b/src/terminal/terminal.h index ee92de9b1..933d4cd3b 100644 --- a/src/terminal/terminal.h +++ b/src/terminal/terminal.h @@ -127,6 +127,9 @@ struct terminal { unsigned int master:1; #ifdef CONFIG_UTF8 + /* Indicates whether the charset of the terminal is UTF-8. */ + unsigned int utf8_cp:1; + /* Indicates whether UTF-8 I/O is used. Forced on if the * UTF-8 charset is selected. (bug 827) */ unsigned int utf8:1;