From 282d0ebbec1d81fbc72e4552322d96f121b0e254 Mon Sep 17 00:00:00 2001 From: Daniel Bertalan Date: Sat, 22 May 2021 22:39:48 +0200 Subject: [PATCH] LibVT: Fix UTF-8 handling in OSC sequences Previously, we would ignore bytes in the `0x80..0xff` range when parsing OSC strings. This caused terminal titles and hyperlinks containing non-ASCII characters to fail. Also added is extending the UTF-8 fail functionality for C1 control codes, since we do not handle those. Fixes #7377 --- Userland/Libraries/LibVT/StateMachine.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Userland/Libraries/LibVT/StateMachine.txt b/Userland/Libraries/LibVT/StateMachine.txt index 037d35ca0c..39343a0bba 100644 --- a/Userland/Libraries/LibVT/StateMachine.txt +++ b/Userland/Libraries/LibVT/StateMachine.txt @@ -20,7 +20,7 @@ Ground { [0x20..0x7f] => (_, Print) - [0xa0..0xc1] => (Ground, FailUTF8) + [0x80..0xc1] => (Ground, FailUTF8) [0xc2..0xdf] => (UTF81ByteNeeded, BeginUTF8) [0xe0..0xef] => (UTF82BytesNeeded, BeginUTF8) [0xf0..0xf4] => (UTF83BytesNeeded, BeginUTF8) @@ -211,7 +211,6 @@ OscString { 0x19 => (_, _) [0x1c..0x1f] => (_, _) - [0x20..0x7f] => (_, OscPut) - 0x9c => (Ground, _) + [0x20..0xff] => (_, OscPut) @exit OscEnd }