summaryrefslogtreecommitdiffstats
path: root/locales/makeCodeList.pl
diff options
context:
space:
mode:
Diffstat (limited to 'locales/makeCodeList.pl')
-rw-r--r--locales/makeCodeList.pl15
1 files changed, 8 insertions, 7 deletions
diff --git a/locales/makeCodeList.pl b/locales/makeCodeList.pl
index f02751e..4f037c4 100644
--- a/locales/makeCodeList.pl
+++ b/locales/makeCodeList.pl
@@ -20,11 +20,13 @@
use strict;
use Unicode::Normalize;
binmode(STDOUT, ":utf8");
+print "[locales]\n";
-my $nameIndex = "iso-639-3_Name_Index_20090210.tab";
-my $langCodes = "iso-639-3_20090210.tab";
-my $deadCodes = "iso-639-3_Retirements_20090126.tab";
+my $nameIndex = "iso-639-3_Name_Index.tab";
+my $langCodes = "iso-639-3.tab";
+my $deadCodes = "iso-639-3_Retirements.tab";
my %names = ();
+
open(my $nameIndexFile, "<:utf8", $nameIndex);
# skip the first line
my $firstLine = <$nameIndexFile>;
@@ -54,15 +56,14 @@ while (<$langFile>)
# ensure it is normalized to NFC
$_ = NFC($_);
my @line = split(/\t/o, $_);
- # exclude extinct languages
- next if ($line[5] eq 'E');
+# # exclude extinct languages
+# next if ($line[5] eq 'E');
my $name = $names{$line[0],$line[6]};
print "$line[3]=$name\n" if ($line[3]);
print "$line[0]=$name\n";
}
-# The dead codes file is iso-8859-1. This may change at some date.
-open(my $deadFile, "<:encoding(iso-8859-1)", $deadCodes);
+open(my $deadFile, "<:utf8", $deadCodes);
# skip the first line
$firstLine = <$deadFile>;
while (<$deadFile>)