pbot-vm: escape malformed Unicode on STDOUT

This commit is contained in:
Pragmatic Software 2022-04-04 22:32:53 -07:00
parent 110912e85d
commit 1c57e01fad
2 changed files with 5 additions and 1 deletions

View File

@ -316,6 +316,10 @@ sub execute {
if ($line =~ /^result:/) {
$line =~ s/^result://;
my $octets = decode('UTF-8', $line, sub { sprintf '\\\\x%X', shift });
$line = encode('UTF-8', $octets, Encode::FB_CROAK);
my $compile_out = decode_json($line);
$result .= "$compile_out->{result}\n";
$got_result = 1;

View File

@ -25,7 +25,7 @@ use PBot::Imports;
# These are set by the /misc/update_version script
use constant {
BUILD_NAME => "PBot",
BUILD_REVISION => 4525,
BUILD_REVISION => 4526,
BUILD_DATE => "2022-04-04",
};