mirror of
https://github.com/perlbot/perlbuut
synced 2025-06-07 16:45:40 -04:00
Fix encoding issue
This commit is contained in:
parent
b8e6138d19
commit
61491f76bd
2 changed files with 5 additions and 4 deletions
|
@ -575,8 +575,8 @@ sub plugin_output {
|
||||||
# Send multiple messages if we're talking in a private chat
|
# Send multiple messages if we're talking in a private chat
|
||||||
# Note that in the future we'll probably want to generalize channels
|
# Note that in the future we'll probably want to generalize channels
|
||||||
# that receive multiple lines and those that don't..
|
# that receive multiple lines and those that don't..
|
||||||
while( length $text ) {
|
|
||||||
$text = Encode::encode( "utf8", $text ); # set it up for raw bytes now
|
$text = Encode::encode( "utf8", $text ); # set it up for raw bytes now
|
||||||
|
while( length $text ) {
|
||||||
my $substr = substr( $text, 0, 400, '' );
|
my $substr = substr( $text, 0, 400, '' );
|
||||||
$pci->yield( privmsg => $said->{name} => $substr );
|
$pci->yield( privmsg => $said->{name} => $substr );
|
||||||
|
|
||||||
|
|
|
@ -60,6 +60,7 @@ $|++;
|
||||||
#*STDOUT = $stdh;
|
#*STDOUT = $stdh;
|
||||||
|
|
||||||
my %exec_map = (
|
my %exec_map = (
|
||||||
|
'perl1' => {bin => '/langs/perl-1.0.16/bin/perl'},
|
||||||
'perl4' => {bin => '/perl5/perlbrew/perls/perl-4.036/bin/perl'},
|
'perl4' => {bin => '/perl5/perlbrew/perls/perl-4.036/bin/perl'},
|
||||||
'perl5.5' => {bin => '/perl5/perlbrew/perls/perl-5.005_04/bin/perl'},
|
'perl5.5' => {bin => '/perl5/perlbrew/perls/perl-5.005_04/bin/perl'},
|
||||||
'perl5.6' => {bin => '/perl5/perlbrew/perls/perl-5.6.2/bin/perl'},
|
'perl5.6' => {bin => '/perl5/perlbrew/perls/perl-5.6.2/bin/perl'},
|
||||||
|
@ -86,7 +87,7 @@ no warnings;
|
||||||
my $sub;
|
my $sub;
|
||||||
{
|
{
|
||||||
no strict; no warnings; no charnames;
|
no strict; no warnings; no charnames;
|
||||||
$sub = eval "use $]; package botdeparse; sub{ $code\n }";
|
$sub = eval "use $]; package botdeparse; sub{ $code\n }; use namespace::autoclean;";
|
||||||
}
|
}
|
||||||
|
|
||||||
my %methods = (map {$_ => botdeparse->can($_)} grep {botdeparse->can($_)} keys {%botdeparse::}->%*);
|
my %methods = (map {$_ => botdeparse->can($_)} grep {botdeparse->can($_)} keys {%botdeparse::}->%*);
|
||||||
|
@ -111,7 +112,7 @@ no warnings;
|
||||||
return $ret;
|
return $ret;
|
||||||
};
|
};
|
||||||
|
|
||||||
for my $sub (keys %methods) {
|
for my $sub (grep {!/^(can|DOES|isa)$/} keys %methods) {
|
||||||
my $ret = $clean_out->($dp->coderef2text($methods{$sub}));
|
my $ret = $clean_out->($dp->coderef2text($methods{$sub}));
|
||||||
|
|
||||||
push @out, "sub $sub {$ret} ";
|
push @out, "sub $sub {$ret} ";
|
||||||
|
@ -408,7 +409,7 @@ Biqsip biqsip 'ugh chan ghitlh lursa' nuh bey' ngun petaq qeng soj tlhej waqboch
|
||||||
}
|
}
|
||||||
';
|
';
|
||||||
|
|
||||||
unless ($version eq '4') {
|
unless ($version eq '4' || $version eq '1') {
|
||||||
exec($exec_map{'perl'.$version}{bin}, '-e', $wrapper) or die "Exec failed $!";
|
exec($exec_map{'perl'.$version}{bin}, '-e', $wrapper) or die "Exec failed $!";
|
||||||
} else {
|
} else {
|
||||||
exec($exec_map{'perl'.$version}{bin}, '-e', $code); # the code for perl4 is actually still in STDIN, if we try to -e it needs to write files
|
exec($exec_map{'perl'.$version}{bin}, '-e', $code); # the code for perl4 is actually still in STDIN, if we try to -e it needs to write files
|
||||||
|
|
Loading…
Add table
Reference in a new issue