Use correct character set for translations and when editing files https://virtualmin.com/node/22973

This commit is contained in:
Jamie Cameron
2012-08-10 23:23:17 -07:00
parent c8a5c76a8c
commit 708225ac19
4 changed files with 20 additions and 8 deletions

View File

@ -467,17 +467,18 @@ else {
}
}
# print_content_type()
# print_content_type([type])
# Prints the content-type header, with a charset
sub print_content_type
{
local $type = $_[0] || "text/plain";
if ($userconfig{'nocharset'} || $config{'nocharset'}) {
# Never try to use charset
print "Content-type: text/plain\n\n";
print "Content-type: $type\n\n";
}
else {
$charset = &get_charset();
print "Content-type: text/plain; charset=$charset\n\n";
print "Content-type: $type; charset=$charset\n\n";
}
}