tools: validate utf8 encoding in stdin/out
[sheet.git] / tools / mkdigraphlist
index a0c5ab23488f8e331a7d876a20a57c4ee2202c1d..3bc6ff4e751927024e318ffc289cb42d176e627e 100755 (executable)
@@ -4,18 +4,19 @@ use strict;
 use warnings;
 use utf8;
 
-use open OUT => ':utf8', ':std';
+use open OUT => ':encoding(utf-8)', ':std';
 
 our $VERSION = '1.06';
 
 # import and combine various digraph data
-my $rfc = do 'data/digraphs-rfc.inc.pl'
+push @INC, 'data';
+my $rfc = do 'digraphs-rfc.inc.pl'
        or die "error reading digraphs include: ", $@ // $!;
-my $extra = do 'data/digraphs-shiar.inc.pl'
+my $extra = do 'digraphs-shiar.inc.pl'
        or warn "could not include shiar proposals: ", $@ // $!;
-my $vim = do 'data/digraphs-vim.inc.pl'
+my $vim = do 'digraphs-vim.inc.pl'
        or warn "could not include vim extensions ", $@ // $!;
-my $vimold = do 'data/digraphs-vim-74.inc.pl'
+my $vimold = do 'digraphs-vim-74.inc.pl'
        or warn "could not include vim compatibility ", $@ // $!;
 my $di = { %{$vim // {}}, %{$rfc}, %{$extra // {}} };