3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-12-23 19:22:40 +01:00

Fix UTF-8 encoding

This commit is contained in:
Pragmatic Software 2023-03-12 18:10:44 -07:00
parent 6565c516e9
commit b9a89e10d6
3 changed files with 4 additions and 4 deletions

View File

@ -9,9 +9,9 @@ use warnings;
use strict; use strict;
use IPC::Run qw/run timeout/; use IPC::Run qw/run timeout/;
use Encode;
use Data::Dumper; use Data::Dumper;
$Data::Dumper::Terse = 1; $Data::Dumper::Terse = 1;
$Data::Dumper::Sortkeys = 1; $Data::Dumper::Sortkeys = 1;
$Data::Dumper::Useqq = 1; $Data::Dumper::Useqq = 1;

View File

@ -309,14 +309,14 @@ sub execute {
my $result = ""; my $result = "";
my $got_result = 0; my $got_result = 0;
while (my $line = <$output>) { while (my $line = decode('UTF-8', <$output>)) {
utf8::decode($line);
$line =~ s/[\r\n]+$//; $line =~ s/[\r\n]+$//;
last if $line =~ /^result:end$/; last if $line =~ /^result:end$/;
if ($line =~ /^result:/) { if ($line =~ /^result:/) {
$line =~ s/^result://; $line =~ s/^result://;
$line = encode('UTF-8', $line);
my $octets = decode('UTF-8', $line, sub { sprintf '\\\\x%02X', shift }); my $octets = decode('UTF-8', $line, sub { sprintf '\\\\x%02X', shift });
$line = encode('UTF-8', $octets, Encode::FB_CROAK); $line = encode('UTF-8', $octets, Encode::FB_CROAK);

View File

@ -25,7 +25,7 @@ use PBot::Imports;
# These are set by the /misc/update_version script # These are set by the /misc/update_version script
use constant { use constant {
BUILD_NAME => "PBot", BUILD_NAME => "PBot",
BUILD_REVISION => 4627, BUILD_REVISION => 4628,
BUILD_DATE => "2023-03-12", BUILD_DATE => "2023-03-12",
}; };