Skip to content

Commit 122a01c

Browse files
committed
try to fix UTF-8 from gist.github.com
1 parent c090c2f commit 122a01c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/EvalbotExecuter.pm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ use Scalar::Util qw(reftype);
7575
use Encode qw(encode);
7676
use charnames qw(:full);
7777
use POSIX ();
78+
use Encode qw/decode_utf8/;
7879

7980
my $max_output_len = 290;
8081

@@ -83,7 +84,7 @@ sub run {
8384
if ($program =~ /^https:\/\/gist\.github\.com\/\d+$/) {
8485
my $page = `curl -s $program`;
8586
$page =~ /href="\/raw([^"]+)"/;
86-
if ($1) { $program = `curl -s https://raw.github.com/gist$1` } else { return 'gist not found' };
87+
if ($1) { $program = decode_utf8 `curl -s https://raw.github.com/gist$1` } else { return 'gist not found' };
8788
}
8889
my $response = _fork_and_eval($program, $executer, $ename);
8990
if (!length $response){

0 commit comments

Comments
 (0)