1
0
mirror of https://github.com/rkd77/elinks.git synced 2025-02-02 15:09:23 -05:00

Bug 914: Add terminal.utf8_cp, not yet read.

This commit is contained in:
Kalle Olavi Niemitalo 2007-05-20 13:50:47 +03:00 committed by Witold Filipczyk
parent 774471b6d1
commit ad669a3f0f
3 changed files with 9 additions and 2 deletions

View File

@ -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 /* Probably not best place for set this. But now we finally have
* term->spec and term->utf8 should be set before decode session info. * term->spec and term->utf8 should be set before decode session info.
* --Scrool */ * --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 /* Force UTF-8 I/O if the UTF-8 charset is selected. Various
* places assume that the terminal's charset is unibyte if * places assume that the terminal's charset is unibyte if
* UTF-8 I/O is disabled. (bug 827) */ * UTF-8 I/O is disabled. (bug 827) */
term->utf8 = get_opt_bool_tree(term->spec, "utf_8_io") term->utf8 = term->utf8_cp
|| is_cp_utf8(get_opt_codepage_tree(term->spec, "charset")); || get_opt_bool_tree(term->spec, "utf_8_io");
#endif /* CONFIG_UTF8 */ #endif /* CONFIG_UTF8 */
} }

View File

@ -360,6 +360,7 @@ add_screen_driver(enum term_mode_type type, struct terminal *term, int env_len)
#ifdef CONFIG_UTF8 #ifdef CONFIG_UTF8
term->utf8 = use_utf8_io(driver); term->utf8 = use_utf8_io(driver);
term->utf8_cp = driver->opt.utf8_cp;
#endif /* CONFIG_UTF8 */ #endif /* CONFIG_UTF8 */
return driver; return driver;
@ -382,6 +383,7 @@ get_screen_driver(struct terminal *term)
#ifdef CONFIG_UTF8 #ifdef CONFIG_UTF8
term->utf8 = use_utf8_io(driver); term->utf8 = use_utf8_io(driver);
term->utf8_cp = driver->opt.utf8_cp;
#endif /* CONFIG_UTF8 */ #endif /* CONFIG_UTF8 */
return driver; return driver;
} }

View File

@ -127,6 +127,9 @@ struct terminal {
unsigned int master:1; unsigned int master:1;
#ifdef CONFIG_UTF8 #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 /* Indicates whether UTF-8 I/O is used. Forced on if the
* UTF-8 charset is selected. (bug 827) */ * UTF-8 charset is selected. (bug 827) */
unsigned int utf8:1; unsigned int utf8:1;