1
0
Fork 0
mirror of https://github.com/perlbot/perlbuut synced 2025-06-07 10:45:40 -04:00

Fix unicode newlines

This commit is contained in:
Ryan Voots 2017-06-12 17:17:32 -04:00
parent 3894a8abc3
commit ba48f6e87f

View file

@ -7,6 +7,7 @@ use Data::Dumper;
use App::EvalServerAdvanced::Protocol;
use Encode;
use strict;
use utf8;
no warnings 'void';
@ -65,12 +66,16 @@ sub command {
if( not $type ) { $type = 'perl'; }
warn "Found $type: $code";
$code = eval {Encode::decode("utf8", $code)} // $code;
if ($command =~ /^([ws]+)?eval/i) {
my $c=$1;
$code = "use warnings; ".$code if ($c =~ /w/);
$code = "use strict; ".$code if ($c =~ /s/);
}
$code = "use utf8; ". $code if ($type =~ /^perl(5.(8|10|12|14|16|18|20|22|24|26))?4/);
$code =~ s/␤/\n/g;
my $resultstr='';