1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

terminal UTF-8: Reject code points reserved for UTF-16 surrogates.

Those code points are allowed in CESU-8 but not in UTF-8.
This commit is contained in:
Kalle Olavi Niemitalo 2006-08-25 22:25:55 +03:00 committed by Kalle Olavi Niemitalo
parent e333fb37ab
commit be7526d00a

View File

@ -337,7 +337,10 @@ handle_interlink_event(struct terminal *term, struct interlink_event *ilev)
if (! --interlink->utf_8.len) { if (! --interlink->utf_8.len) {
unicode_val_T u = interlink->utf_8.ucs; unicode_val_T u = interlink->utf_8.ucs;
if (u < interlink->utf_8.min) /* UTF-8 allows neither overlong
* sequences nor surrogates. */
if (u < interlink->utf_8.min
|| is_utf16_surrogate(u))
u = UCS_REPLACEMENT_CHARACTER; u = UCS_REPLACEMENT_CHARACTER;
term_send_ucs(term, u, term_send_ucs(term, u,
term->interlink->utf_8.modifier); term->interlink->utf_8.modifier);