getsource: default to saying page source is in UTF-8, and make the example match the default

IkiWiki mostly assumes that pages are in UTF-8; anyone this doesn't work
for can override it in the setup file.
master
Simon McVittie 2009-07-26 16:36:17 +01:00
parent eaf59e5ba9
commit 3f520da78a
1 changed files with 2 additions and 2 deletions

View File

@ -20,7 +20,7 @@ sub getsetup () {
}, },
getsource_mimetype => { getsource_mimetype => {
type => "string", type => "string",
example => "application/octet-stream", example => "text/plain; charset=utf-8",
description => "Mime type for returned source.", description => "Mime type for returned source.",
safe => 1, safe => 1,
rebuild => 0, rebuild => 0,
@ -60,7 +60,7 @@ sub cgi_getsource ($) {
my $data = IkiWiki::readfile(IkiWiki::srcfile($IkiWiki::pagesources{$page})); my $data = IkiWiki::readfile(IkiWiki::srcfile($IkiWiki::pagesources{$page}));
if (! $config{getsource_mimetype}) { if (! $config{getsource_mimetype}) {
$config{getsource_mimetype} = "text/plain"; $config{getsource_mimetype} = "text/plain; charset=utf-8";
} }
print "Content-Type: $config{getsource_mimetype}\r\n"; print "Content-Type: $config{getsource_mimetype}\r\n";