mirror of
https://github.com/perlbot/perlbuut
synced 2025-06-07 16:35:40 -04:00
Fix unicode newlines
This commit is contained in:
parent
3894a8abc3
commit
ba48f6e87f
1 changed files with 5 additions and 0 deletions
|
@ -7,6 +7,7 @@ use Data::Dumper;
|
||||||
use App::EvalServerAdvanced::Protocol;
|
use App::EvalServerAdvanced::Protocol;
|
||||||
use Encode;
|
use Encode;
|
||||||
use strict;
|
use strict;
|
||||||
|
use utf8;
|
||||||
|
|
||||||
no warnings 'void';
|
no warnings 'void';
|
||||||
|
|
||||||
|
@ -65,12 +66,16 @@ sub command {
|
||||||
if( not $type ) { $type = 'perl'; }
|
if( not $type ) { $type = 'perl'; }
|
||||||
warn "Found $type: $code";
|
warn "Found $type: $code";
|
||||||
|
|
||||||
|
$code = eval {Encode::decode("utf8", $code)} // $code;
|
||||||
|
|
||||||
if ($command =~ /^([ws]+)?eval/i) {
|
if ($command =~ /^([ws]+)?eval/i) {
|
||||||
my $c=$1;
|
my $c=$1;
|
||||||
$code = "use warnings; ".$code if ($c =~ /w/);
|
$code = "use warnings; ".$code if ($c =~ /w/);
|
||||||
$code = "use strict; ".$code if ($c =~ /s/);
|
$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;
|
$code =~ s//\n/g;
|
||||||
|
|
||||||
my $resultstr='';
|
my $resultstr='';
|
||||||
|
|
Loading…
Add table
Reference in a new issue