mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
vt: utf8: insert a REPLACEMENT CHARACTER when an invalid UTF-8 sequence is detected
This commit is contained in:
parent
878e07da59
commit
a02c0c8d4d
1 changed files with 6 additions and 6 deletions
12
vt.c
12
vt.c
|
|
@ -1041,7 +1041,7 @@ state_utf8_21_switch(struct terminal *term, uint8_t data)
|
||||||
switch (data) {
|
switch (data) {
|
||||||
/* exit current enter new state */
|
/* exit current enter new state */
|
||||||
case 0x80 ... 0xbf: action_utf8_22(term, data); return STATE_GROUND;
|
case 0x80 ... 0xbf: action_utf8_22(term, data); return STATE_GROUND;
|
||||||
default: return state_ground_switch(term, data);
|
default: action_utf8_print(term, 0xfffd); return state_ground_switch(term, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1051,7 +1051,7 @@ state_utf8_31_switch(struct terminal *term, uint8_t data)
|
||||||
switch (data) {
|
switch (data) {
|
||||||
/* exit current enter new state */
|
/* exit current enter new state */
|
||||||
case 0x80 ... 0xbf: action_utf8_32(term, data); return STATE_UTF8_32;
|
case 0x80 ... 0xbf: action_utf8_32(term, data); return STATE_UTF8_32;
|
||||||
default: return state_ground_switch(term, data);
|
default: action_utf8_print(term, 0xfffd); return state_ground_switch(term, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1061,7 +1061,7 @@ state_utf8_32_switch(struct terminal *term, uint8_t data)
|
||||||
switch (data) {
|
switch (data) {
|
||||||
/* exit current enter new state */
|
/* exit current enter new state */
|
||||||
case 0x80 ... 0xbf: action_utf8_33(term, data); return STATE_GROUND;
|
case 0x80 ... 0xbf: action_utf8_33(term, data); return STATE_GROUND;
|
||||||
default: return state_ground_switch(term, data);
|
default: action_utf8_print(term, 0xfffd); return state_ground_switch(term, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1071,7 +1071,7 @@ state_utf8_41_switch(struct terminal *term, uint8_t data)
|
||||||
switch (data) {
|
switch (data) {
|
||||||
/* exit current enter new state */
|
/* exit current enter new state */
|
||||||
case 0x80 ... 0xbf: action_utf8_42(term, data); return STATE_UTF8_42;
|
case 0x80 ... 0xbf: action_utf8_42(term, data); return STATE_UTF8_42;
|
||||||
default: return state_ground_switch(term, data);
|
default: action_utf8_print(term, 0xfffd); return state_ground_switch(term, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1081,7 +1081,7 @@ state_utf8_42_switch(struct terminal *term, uint8_t data)
|
||||||
switch (data) {
|
switch (data) {
|
||||||
/* exit current enter new state */
|
/* exit current enter new state */
|
||||||
case 0x80 ... 0xbf: action_utf8_43(term, data); return STATE_UTF8_43;
|
case 0x80 ... 0xbf: action_utf8_43(term, data); return STATE_UTF8_43;
|
||||||
default: return state_ground_switch(term, data);
|
default: action_utf8_print(term, 0xfffd); return state_ground_switch(term, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1091,7 +1091,7 @@ state_utf8_43_switch(struct terminal *term, uint8_t data)
|
||||||
switch (data) {
|
switch (data) {
|
||||||
/* exit current enter new state */
|
/* exit current enter new state */
|
||||||
case 0x80 ... 0xbf: action_utf8_44(term, data); return STATE_GROUND;
|
case 0x80 ... 0xbf: action_utf8_44(term, data); return STATE_GROUND;
|
||||||
default: return state_ground_switch(term, data);
|
default: action_utf8_print(term, 0xfffd); return state_ground_switch(term, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue