]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/po.pm
po(refreshpot): define the input charset before read()'ing
[ikiwiki.git] / IkiWiki / Plugin / po.pm
index 89bd9947028fb759ca7ee5d62b267bffa8d3c06d..7bc702eca180bc54aaa9f9a872fa2c554a0c2ca6 100644 (file)
@@ -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.