countries: mark user-assignments with semantics in unicode
[sheet.git] / tools / mkcountries-geonames
index 2f124513f687c2f61b9ba7cb908173552b783d8b..5128d5a9153b4c801eec8a31fb097dc0336e3d75 100755 (executable)
@@ -35,7 +35,7 @@ my %cc;  # map of country code to info array
        lf => ["indeterminately reserved: Libya Fezzan", "c-af Xr", "Fezzan", 'ly'],
        pi => ["indeterminately reserved: Philippines", "c-as Xr", "(Philippines)", 'ph'],
        ra => ["indeterminately reserved: Argentina", "c-sa Xr", "(Argentina)", 'ar'],
-       rb => ["indeterminately reserved: Botswana, Bolivia", "c-sa Xr", "(Bots...)"],
+       rb => ["indeterminately reserved: Botswana, Bolivia", "c-sa Xr", "(Bots...)", 'bw bo'],
        rc => ["indeterminately reserved: Republic of China", "c-as Xr", "(RoC)", 'tw'],
        rh => ["indeterminately reserved: Haiti", "c-na Xr", "(Haiti)", 'ht'],
        ri => ["indeterminately reserved: Indonesia", "c-as Xr", "(Indonesia)", 'id'],
@@ -60,6 +60,11 @@ my %cc;  # map of country code to info array
        ib => ["not used: International Bureau of WIPO", "Xi", "IB"],
        oa => ["not used: African Intellectual Property Organization", "Xi", "OAPI"], # c-af
        wo => ["not used: World Intellectual Property Organization", "Xi", "WIPO"],
+
+       # unicode identifiers
+       qo => ["Unicode semantics: Outlying Oceania", "c-oc Co Xi", "Oceania"],
+       qu => ["Unicode semantics: European Union deprecated reserve", "c-eu Co Xi", "EU", 'eu'],
+       zz => ["Unicode semantics: unknown or invalid territory", "Co Xi","unknown"],
 );
 
 while (<>) {
@@ -67,7 +72,7 @@ while (<>) {
        my ($iso, $name, $cont, $tld) = (split /\t/)[0, 4, 8, 9];
        my @info = ($name, "c-\L$cont");
        $info[3] = $tld if $tld =~ s/\A\.// and $tld ne lc $iso;
-       $cc{ lc $iso } = \@info;
+       $cc{ lc $iso } //= \@info;
 }
 
 $cc{io}->[2] = "Chagos Islands";