3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-20 02:49:49 +01:00

Fix utf8 encoding issue with code-factoids?

This commit is contained in:
Pragmatic Software 2017-11-27 19:18:00 -08:00
parent 356efe0a8a
commit 1b13f00503

View File

@ -697,6 +697,11 @@ sub execute_code_factoid_using_vm {
$h{'persist-key'} = $self->{factoids}->hash->{$stuff->{channel}}->{$stuff->{keyword}}->{'persist-key'};
}
# not sure why we need this here, but it seems to stop strange
# text encoding issues in the following encode_json call
use Encode;
$h{arguments} = decode('utf8', $h{arguments});
my $json = encode_json \%h;
$stuff->{special} = 'code-factoid';