source: keep original file encoding
[sheet.git] / source.plp
index 269e342a2c331a31aa2cd3f6f82a13cae54b34a9..5d445e5658f530539b79108238e0266b6a286a62 100644 (file)
@@ -10,7 +10,7 @@ if ($source =~ s{(?<=\Q.inc.pl\E)/jsonp?$}{} and -r $source) {
                my $data = do $source or die $@ || $! || 'read error';
                require JSON;
                my $converter = JSON->new;
-               $converter->utf8->indent->space_after->canonical;
+               $converter->indent->space_after->canonical;
 
                $header{content_type} = 'application/json';
                $header{content_type} = 'text/plain' if exists $get{debug};
@@ -55,7 +55,9 @@ if (not $source) {
 }
 else {
        my $href = showlink($source, $source =~ m{\A (\w+) \.plp \z}x && "/$1");
-       say "<h1>Source of $href</h1>";
+       PLP_START {
+               say "<h1>Source of $href</h1>";
+       };
 
        if ($source =~ m{(?:/|^)\.}) {
                Abort("File request not permitted", '403 source not allowed');