summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/po.pm
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2008-11-08 21:32:04 +0100
committerintrigeri <intrigeri@boum.org>2008-11-08 21:32:04 +0100
commit646d7bf6a3c9d4f153f8129400a24ad147dcd67c (patch)
tree2857f0b7edaee151ffe09a535ad9221ef2de1f07 /IkiWiki/Plugin/po.pm
parent7691899da03a972ab89d6294478df281a3aa6e0f (diff)
po(refreshpot): define the input charset before read()'ing
... to prevent the use of Encode::Guess::guess_encoding() in Locale::Po4a::Transtractor (just a minor security measure, dependent on po4a internals, but we have no reason to think Encode::Guess is not safe). Signed-off-by: intrigeri <intrigeri@boum.org>
Diffstat (limited to 'IkiWiki/Plugin/po.pm')
-rw-r--r--IkiWiki/Plugin/po.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm
index 89bd99470..7bc702eca 100644
--- a/IkiWiki/Plugin/po.pm
+++ b/IkiWiki/Plugin/po.pm
@@ -166,10 +166,10 @@ sub refreshpot ($) { #{{{
my $potfile=potfile($masterfile);
my %options = ("markdown" => (pagetype($masterfile) eq 'mdwn') ? 1 : 0);
my $doc=Locale::Po4a::Chooser::new('text',%options);
- $doc->read($masterfile);
$doc->{TT}{utf_mode} = 1;
$doc->{TT}{file_in_charset} = 'utf-8';
$doc->{TT}{file_out_charset} = 'utf-8';
+ $doc->read($masterfile);
# let's cheat a bit to force porefs option to be passed to Locale::Po4a::Po;
# this is undocument use of internal Locale::Po4a::TransTractor's data,
# compulsory since this module prevents us from using the porefs option.