Commit 042f10ec authored by Antonino A. Daplas's avatar Antonino A. Daplas Committed by Linus Torvalds

vt: expose system-wide UTF-8 default setting via sysfs

Create a variable, default_utf8, that defines the system-wide default UTF-8
setting.  This variable can be altered via sysfs. If the variable is properly
set, this should mimimize breakage of UTF-8 encoded consoles when doing a
reset or echo -e '\033c' and of newly opened/allocated consoles.

This is based from patches by Jan Engelhardt and Paul LeoNerd Evans.
Signed-off-by: default avatarAntonino Daplas <adaplas@gmail.com>
Cc: Jan Engelhardt <jengelh@linux01.gwdg.de>
Cc: Paul LeoNerd Evans <leonerd@leonerd.org.uk>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent d1e23066
...@@ -157,6 +157,8 @@ static void blank_screen_t(unsigned long dummy); ...@@ -157,6 +157,8 @@ static void blank_screen_t(unsigned long dummy);
static void set_palette(struct vc_data *vc); static void set_palette(struct vc_data *vc);
static int printable; /* Is console ready for printing? */ static int printable; /* Is console ready for printing? */
static int default_utf8;
module_param(default_utf8, int, S_IRUGO | S_IWUSR);
/* /*
* ignore_poke: don't unblank the screen when things are typed. This is * ignore_poke: don't unblank the screen when things are typed. This is
...@@ -1517,7 +1519,7 @@ static void reset_terminal(struct vc_data *vc, int do_clear) ...@@ -1517,7 +1519,7 @@ static void reset_terminal(struct vc_data *vc, int do_clear)
vc->vc_charset = 0; vc->vc_charset = 0;
vc->vc_need_wrap = 0; vc->vc_need_wrap = 0;
vc->vc_report_mouse = 0; vc->vc_report_mouse = 0;
vc->vc_utf = 0; vc->vc_utf = default_utf8;
vc->vc_utf_count = 0; vc->vc_utf_count = 0;
vc->vc_disp_ctrl = 0; vc->vc_disp_ctrl = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment