Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
try to fix UTF-8 from gist.github.com
  • Loading branch information
moritz committed Oct 25, 2011
1 parent c090c2f commit 122a01c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/EvalbotExecuter.pm
Expand Up @@ -75,6 +75,7 @@ use Scalar::Util qw(reftype);
use Encode qw(encode);
use charnames qw(:full);
use POSIX ();
use Encode qw/decode_utf8/;

my $max_output_len = 290;

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

0 comments on commit 122a01c

Please sign in to comment.