diff --git a/PBot/Interpreter.pm b/PBot/Interpreter.pm index e86b6677..53423932 100644 --- a/PBot/Interpreter.pm +++ b/PBot/Interpreter.pm @@ -82,6 +82,7 @@ sub process_line { $text =~ s/^\s+//; $text =~ s/\s+$//; + $text =~ s/([\01-\010]|[\016-\037])/'\\' . ord $1/ge; my $cmd_text = $text; $cmd_text =~ s/^\/me\s+//; diff --git a/PBot/Logger.pm b/PBot/Logger.pm index 10d99376..fa28d41f 100644 --- a/PBot/Logger.pm +++ b/PBot/Logger.pm @@ -36,7 +36,7 @@ sub log { my ($self, $text) = @_; my $time = localtime; - $text =~ s/(?:[\01-\010]|[\016-\037])/^/g; + $text =~ s/([\01-\010]|[\016-\037])/'\\' . ord $1/ge; if(defined $self->{log_file}) { print PLOG_FILE "$time :: $text";