3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-22 20:09:43 +01:00

Replace unicode quotes with apostrophes for non-unicode clients

This commit is contained in:
Pragmatic Software 2010-05-10 00:14:45 +00:00
parent 8ebe546850
commit 7b4d15191a

View File

@ -146,7 +146,7 @@ if($languages{$lang}{'id'} == 1 or $languages{$lang}{'id'} == 11 or $languages{$
if(not $has_main) {
$code = "$prelude\n\n$code\n\nint main(int argc, char **argv) { $precode return 0;}\n";
$nooutput = "Success.";
$nooutput = "Success [no output].";
} else {
$code = "$prelude\n\n$code\n\n$precode\n";
$nooutput = "No output.";
@ -306,6 +306,11 @@ $output =~ s/prog\.c[:\d\s]*//g;
$output =~ s/ld: warning: cannot find entry symbol _start; defaulting to [^ ]+//;
$output =~ s/error: (.*?) error/error: $1; error/msg;
my $left_quote = chr(226) . chr(128) . chr(152);
my $right_quote = chr(226) . chr(128) . chr(153);
$output =~ s/$left_quote/'/g;
$output =~ s/$right_quote/'/g;
$output = $nooutput if $output =~ m/^\s+$/;
print FILE localtime() . "\n";