Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

vt: make use of ucs_get_fallback() when glyph is unavailable

Attempt to display a fallback character when given character doesn't
have an available glyph. The substitution may not be as good as the
original character but still way more helpful than a squared question
mark.

Example substitutions: À -> A, ç -> c, ø -> o, ─ -> -, © -> C, etc.

See gen_ucs_fallback_table.py for a comprehensive list.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Link: https://lore.kernel.org/r/20250507141535.40655-8-nico@fluxnic.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Nicolas Pitre and committed by
Greg Kroah-Hartman
6802f359 fe26933c

+13
+13
drivers/tty/vt/vt.c
··· 3007 3007 return tc; 3008 3008 } 3009 3009 3010 + /* 3011 + * The Unicode screen memory is allocated only when required. 3012 + * This is one such case: we're about to "cheat" with the displayed 3013 + * character meaning the simple screen buffer won't hold the original 3014 + * information, whereas the Unicode screen buffer always does. 3015 + */ 3016 + vc_uniscr_check(vc); 3017 + 3018 + /* Try getting a simpler fallback character. */ 3019 + tc = ucs_get_fallback(tc); 3020 + if (tc) 3021 + return vc_get_glyph(vc, tc); 3022 + 3010 3023 /* Display U+FFFD (Unicode Replacement Character). */ 3011 3024 return conv_uni_to_pc(vc, UCS_REPLACEMENT); 3012 3025 }