pod: Fix "wide character in print" warnings by declaring encoding correctly.

This commit is contained in:
Richard W.M. Jones
2013-04-05 10:33:25 +01:00
parent dfa25a46e3
commit a3de6eddd4
2 changed files with 2 additions and 0 deletions

View File

@@ -309,6 +309,7 @@ let pod2text ?width ?(trim = true) ?(discard = true) name longdesc =
try Hashtbl.find pod2text_memo key try Hashtbl.find pod2text_memo key
with Not_found -> with Not_found ->
let filename, chan = Filename.open_temp_file "gen" ".tmp" in let filename, chan = Filename.open_temp_file "gen" ".tmp" in
fprintf chan "=encoding utf8\n\n";
fprintf chan "=head1 %s\n\n%s\n" name longdesc; fprintf chan "=head1 %s\n\n%s\n" name longdesc;
close_out chan; close_out chan;
let cmd = let cmd =

View File

@@ -515,6 +515,7 @@ if ($text) {
$parser->output_string (\$output); $parser->output_string (\$output);
$parser->parse_string_document ($content); $parser->parse_string_document ($content);
open OUT, ">$text" or die "$progname: $text: $!"; open OUT, ">$text" or die "$progname: $text: $!";
binmode OUT, ":utf8";
print OUT $output or die "$progname: $text: $!"; print OUT $output or die "$progname: $text: $!";
close OUT or die "$progname: $text: $!"; close OUT or die "$progname: $text: $!";
print "$progname: wrote $text\n"; print "$progname: wrote $text\n";