vt: support Unicode recomposition

Try replacing any decomposed Unicode sequence by the corresponding
recomposed code point. Code point to glyph correspondance works best
after recomposition, and this apply mostly to single-width code points
therefore we can't preserve them in their decomposed form anyway.

With all the infrastructure in place this is now trivial to do.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Link: https://lore.kernel.org/r/20250410011839.64418-9-nico@fluxnic.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Nicolas Pitre
2025-04-09 21:14:00 -04:00
committed by Greg Kroah-Hartman
parent 54af55b990
commit cd6937d42b
+9 -2
View File
@@ -2953,8 +2953,15 @@ static int vc_con_write_normal(struct vc_data *vc, int tc, int c,
* double-width.
*/
} else {
/* Otherwise zero-width code points are ignored */
goto out;
/* try recomposition */
prev_c = ucs_recompose(prev_c, c);
if (prev_c != 0) {
vc_con_rewind(vc);
c = prev_c;
} else {
/* Otherwise zero-width code points are ignored */
goto out;
}
}
}
}