IP.pm

filter: Statementstmt 67.6% 332 / 491 Branchbran 43.2% 83 / 192 Conditioncond 56.4% 35 / 62 MC/DCmcdc 23.3% 7 / 30 Subroutinesub 65.4% 53 / 81 Podpod 70.7% 29 / 41 totaltotal 60.0% 539 / 897 CC 118 SCAR 25.6
CC
118
Cov
60%
_setup_segments
59.3
_get_city_record_seek
27.5
open
14.6
CRAP 12.9
↑ Summary IP/Record.pm »
1 package Geo::IP;
2  
3 7 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 7 ▶use base qw(Exporter);
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 7 our $VERSION;
8  
9 7 our @ISA;
10  
11 7 our $GEOIP_PP_ONLY = 0;
12 7 our $XS_VERSION;
13  
14 7 our @EXPORT = qw(
15 GEOIP_STANDARD GEOIP_MEMORY_CACHE
16 GEOIP_CHECK_CACHE GEOIP_INDEX_CACHE
17 GEOIP_UNKNOWN_SPEED GEOIP_DIALUP_SPEED
18 GEOIP_CABLEDSL_SPEED GEOIP_CORPORATE_SPEED
19 GEOIP_COUNTRY_EDITION GEOIP_REGION_EDITION_REV0
20 GEOIP_CITY_EDITION_REV0 GEOIP_ORG_EDITION
21 GEOIP_ISP_EDITION GEOIP_CITY_EDITION_REV1
22 GEOIP_REGION_EDITION_REV1 GEOIP_PROXY_EDITION
23 GEOIP_ASNUM_EDITION GEOIP_NETSPEED_EDITION
24 GEOIP_CHARSET_ISO_8859_1 GEOIP_CHARSET_UTF8
25 GEOIP_MMAP_CACHE GEOIP_ACCURACYRADIUS_EDITION
26 GEOIP_COUNTRY_EDITION_V6 GEOIP_DOMAIN_EDITION
27 GEOIP_NETSPEED_EDITION_REV1 GEOIP_SILENCE
28 );
29  
30 7 ▶BEGIN {
Subroutine BEGIN: called CC=4 SCAR=15.0
31 7 $VERSION = '1.51';
32 eval {
33  
34 # PERL_DL_NONLAZY must be false, or any errors in loading will just
35 # cause the perl code to be tested
36 7 ▶ local $ENV{PERL_DL_NONLAZY} = 0 if $ENV{PERL_DL_NONLAZY};
Branch: 1 branch
BranchTrueFalseTotal
if $ENV{"PERL_DL_NONLAZY"} 7 0 7
37  
38 7 require DynaLoader;
39 7 local @ISA = qw(DynaLoader);
40 7 bootstrap Geo::IP $VERSION;
41 7 ▶ } unless $GEOIP_PP_ONLY || $ENV{GEOIP_PP_ONLY};
Branch: 1 branch
BranchTrueFalseTotal
unless $Geo::IP::GEOIP_PP_ONLY or $ENV{"GEOIP_PP_ONLY"} 7 0 7
Condition33%1/3
$Geo::IP::GEOIP_PP_ONLY or $ENV{"GEOIP_PP_ONLY"}
l!l&&r!l&&!r
007
MC/DC0%0/2
$Geo::IP::GEOIP_PP_ONLY or $ENV{"GEOIP_PP_ONLY"}
$Geo::IP::GEOIP_PP_ONLY $ENV{"GEOIP_PP_ONLY"}
Truth table33%1/3
A or B
A= $Geo::IP::GEOIP_PP_ONLYB= $ENV{"GEOIP_PP_ONLY"}
ABresult
1X1
011
000
42 }
43  
44 7 require Geo::IP::Record;
45  
46 sub GEOIP_STANDARD() { 0; } # PP
47 sub GEOIP_MEMORY_CACHE() { 1; } # PP
48 sub GEOIP_CHECK_CACHE() { 2; }
49 sub GEOIP_INDEX_CACHE() { 4; }
50 sub GEOIP_MMAP_CACHE() { 8; } # PP
51 sub GEOIP_SILENCE() { 16; }
52  
53 sub GEOIP_UNKNOWN_SPEED() { 0; } #PP
54 sub GEOIP_DIALUP_SPEED() { 1; } #PP
55 sub GEOIP_CABLEDSL_SPEED() { 2; } #PP
56 sub GEOIP_CORPORATE_SPEED() { 3; } #PP
57  
58 7 ▶BEGIN {
Subroutine BEGIN: called CC=4 SCAR=14.5
59  
60 #my $pp = !( defined &_XScompiled && &_XScompiled && !$TESTING_PERL_ONLY );
61 7 my $pp = !defined &open;
62  
63 sub GEOIP_COUNTRY_EDITION() { 1; }
64 sub GEOIP_CITY_EDITION_REV1() { 2; }
65 sub GEOIP_REGION_EDITION_REV1() { 3; }
66 sub GEOIP_ISP_EDITION() { 4; }
67 sub GEOIP_ORG_EDITION() { 5; }
68 sub GEOIP_CITY_EDITION_REV0() { 6; }
69 sub GEOIP_REGION_EDITION_REV0() { 7; }
70 sub GEOIP_PROXY_EDITION() { 8; }
71 sub GEOIP_ASNUM_EDITION() { 9; }
72 sub GEOIP_NETSPEED_EDITION() { 10; }
73 sub GEOIP_DOMAIN_EDITION() { 11; }
74 sub GEOIP_COUNTRY_EDITION_V6() { 12; }
75 sub GEOIP_ACCURACYRADIUS_EDITION() { 14; }
76 sub GEOIP_ASNUM_EDITION_V6() { 21; }
77 sub GEOIP_CITY_EDITION_REV1_V6() { 30; }
78 sub GEOIP_CITY_EDITION_REV0_V6() { 31; }
79 sub GEOIP_NETSPEED_EDITION_REV1() { 32; }
80  
81 sub GEOIP_CHARSET_ISO_8859_1() { 0; }
82 sub GEOIP_CHARSET_UTF8() { 1; }
83  
84 #
85 3 ▶ sub api {
Subroutine api: called CC=2 SCAR=7.6
Pod documented
86 3 ▶ defined &Geo::IP::Record::_XScompiled ? 'CAPI' : 'PurePerl';
Branch: 1 branch
BranchTrueFalseTotal
defined &Geo::IP::Record::_XScompiled ? : 0 3 3
87 }
88  
89 # cheat --- try to load Sys::Mmap PurePerl only
90 7 ▶ if ($pp) {
Branch: 1 branch
BranchTrueFalseTotal
if ($pp) { } 7 0 7
91 7 eval {
92  
93 # wrap into eval again, as workaround for centos / mod_perl issue
94 # seems they use $@ without eval somewhere
95 eval "require Sys::Mmap"
96 ? Sys::Mmap->import
97 7 ▶ : do {
Branch: 1 branch
BranchTrueFalseTotal
eval 'require Sys::Mmap' ? : 0 7 7
98 7 for (qw/ PROT_READ MAP_PRIVATE MAP_SHARED /) {
99 7 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
100 21 my $unused_stub = $_; # we must use a copy
101 *$unused_stub
102 0 ▶ = sub { die 'Sys::Mmap required for mmap support' };
Subroutine __ANON__: not called CC=1 SCAR=1.2
103 } # for
104 }; # do
105 7 1;
106 }; # eval
107 } # pp
108 else {
109 0 eval << '__CAPI_GLUE__';
110 # threads should not clone or DESTROY the GeoIP object.
111 sub CLONE_SKIP {1}
112  
113 *name_by_name = *isp_by_name = *org_by_name;
114 *name_by_addr = *isp_by_addr = *org_by_addr;
115  
116 *org_by_name_v6 = *name_by_name_v6;
117 *org_by_addr_v6 = *name_by_addr_v6;
118 __CAPI_GLUE__
119 }
120 }
121  
122 0 ▶eval << '__PP_CODE__' unless defined &open;
Subroutine BEGIN: called CC=1 SCAR=0.7
Subroutine BEGIN: called CC=1 SCAR=0.7
Subroutine BEGIN: called CC=1 SCAR=0.7
Subroutine BEGIN: called CC=1 SCAR=0.7
Subroutine BEGIN: called CC=1 SCAR=0.7
Subroutine BEGIN: called CC=1 SCAR=0.7
Subroutine BEGIN: called CC=2 SCAR=8.2
Subroutine BEGIN: called CC=1 SCAR=0.7
Subroutine BEGIN: called CC=1 SCAR=0.7
Subroutine BEGIN: called CC=1 SCAR=0.7
Subroutine BEGIN: called CC=1 SCAR=0.7
Subroutine BEGIN: called CC=1 SCAR=0.7
Subroutine BEGIN: called CC=1 SCAR=0.7
Subroutine BEGIN: called CC=1 SCAR=0.7
Subroutine BEGIN: called CC=1 SCAR=0.7
Subroutine BEGIN: called CC=1 SCAR=0.7
Subroutine BEGIN: called CC=1 SCAR=0.7
Subroutine BEGIN: called CC=1 SCAR=0.7
Subroutine BEGIN: called CC=1 SCAR=0.7
Subroutine BEGIN: called CC=1 SCAR=0.7
Subroutine BEGIN: called CC=1 SCAR=0.7
Subroutine BEGIN: called CC=1 SCAR=0.7
Subroutine BEGIN: called CC=1 SCAR=0.7
Subroutine BEGIN: called CC=1 SCAR=0.7
Subroutine BEGIN: called CC=1 SCAR=0.7
Subroutine DESTROY: called CC=5 SCAR=19.0
Subroutine __ANON__: not called CC=2 SCAR=8.2
Subroutine __ANON__: not called CC=1 SCAR=0.7
Subroutine _common_org: called CC=4 SCAR=16.3
Subroutine _get_city_record_seek: called CC=14 SCAR=33.1
Subroutine _get_region_name: called CC=4 SCAR=16.3
Subroutine _seek_country: called CC=6 SCAR=21.4
Subroutine _seek_country_v6: called CC=6 SCAR=21.4
Subroutine _setup_segments: called CC=23 SCAR=40.8
Subroutine addr_to_num: called CC=1 SCAR=0.7
Subroutine charset: called CC=1 SCAR=0.7
Subroutine continent_code_by_country_code: not called CC=2 SCAR=8.2
Subroutine country_code3_by_addr: not called CC=2 SCAR=8.2
Subroutine country_code3_by_addr_v6: not called CC=1 SCAR=0.7
Subroutine country_code3_by_name: not called CC=1 SCAR=0.7
Subroutine country_code3_by_name_v6: not called CC=1 SCAR=0.7
Subroutine country_code_by_addr: called CC=2 SCAR=8.2
Subroutine country_code_by_addr_v6: called CC=1 SCAR=0.7
Subroutine country_code_by_name: not called CC=1 SCAR=0.7
Subroutine country_code_by_name_v6: not called CC=1 SCAR=0.7
Subroutine country_name_by_addr: called CC=2 SCAR=8.2
Subroutine country_name_by_addr_v6: not called CC=1 SCAR=0.7
Subroutine country_name_by_name: not called CC=1 SCAR=0.7
Subroutine country_name_by_name_v6: not called CC=1 SCAR=0.7
Subroutine database_edition: not called CC=1 SCAR=0.7
Subroutine database_info: not called CC=6 SCAR=21.4
Subroutine get_city_record: called CC=3 SCAR=12.9
Subroutine get_city_record_as_hash: called CC=2 SCAR=8.2
Subroutine get_city_record_as_hash_v6: not called CC=2 SCAR=8.2
Subroutine get_city_record_v6: not called CC=3 SCAR=12.9
Subroutine get_ip_address: called CC=2 SCAR=8.2
Subroutine get_ip_address_v6: called CC=3 SCAR=12.9
Subroutine id_by_addr: called CC=2 SCAR=8.2
Subroutine id_by_addr_v6: called CC=2 SCAR=8.2
Subroutine id_by_name: not called CC=3 SCAR=12.9
Subroutine id_by_name_v6: not called CC=2 SCAR=8.2
Subroutine last_netmask: not called CC=1 SCAR=0.7
Subroutine netmask: not called CC=1 SCAR=0.7
Subroutine new: not called CC=5 SCAR=19.0
Subroutine num_to_addr: not called CC=1 SCAR=0.7
Subroutine open: called CC=9 SCAR=26.8
Subroutine open_type: not called CC=6 SCAR=21.4
Subroutine org_by_addr: called CC=1 SCAR=0.7
Subroutine org_by_addr_v6: called CC=2 SCAR=8.2
Subroutine org_by_name: not called CC=1 SCAR=0.7
Subroutine range_by_ip: not called CC=5 SCAR=19.0
Subroutine region_by_name: called CC=9 SCAR=26.8
Subroutine set_charset: not called CC=1 SCAR=0.7
Subroutine time_zone: not called CC=1 SCAR=0.7
Pod undocumented
Pod documented
Pod documented
Pod documented
Pod documented
Pod documented
Pod documented
Pod documented
Pod documented
Pod documented
Pod documented
Pod documented
Pod undocumented
Pod documented
Pod undocumented
Pod documented
Pod documented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod documented
Pod undocumented
Pod documented
Pod undocumented
Pod documented
Pod documented
Pod documented
Pod undocumented
Pod documented
Pod documented
Pod documented
Pod documented
Pod documented
Pod documented
Pod documented
Pod documented
Pod documented
Branch: 90 branches
BranchTrueFalseTotal
if ($] >= 5.008) { } 7 0 7
if (exists $gi->{"buf"} and $gi->{"flags"} and $gi->{"flags"} & 8) 0 11 11
munmap($gi->{"buf"}) or die "munmap: $!" 0 0 0
$c >= 192 ? : 0 0 0
if ($seek_org == $gi->{"databaseSegments"}) 0 7 7
if (exists $gi->{'buf'}) { } 0 7 7
if $gi->charset == 1 0 7 7
if (exists $gi->{'buf'}) { } 0 1 1
if ($char != 0) 2 1 3
if ($str_length > 0) 1 0 1
if ($char != 0) 10 1 11
if ($str_length > 0) 1 0 1
if ($char != 0) 5 1 6
if ($str_length > 0) 1 0 1
if ($j < 3) 3 1 4
if ($j < 3) 3 1 4
if (2 == $gi->{"databaseType"}) 1 0 1
if ($record_country_code eq "US") 1 0 1
if ($j < 3) 3 1 4
if $gi->charset == 1 0 1 1
unless $region 0 1 1
if $region eq "00" 0 1 1
if exists $country_region_names{$ccode} 1 0 1
if ($depth >= 0) 241 0 241
if (exists $gi->{'buf'}) { } 0 241 241
if ($ipnum & 1 << $depth) { } 113 128 241
if ($x1 >= $gi->{"databaseSegments"}) 8 105 113
if ($x0 >= $gi->{"databaseSegments"}) 1 127 128
if (exists $gi->{'buf'}) { } 0 128 128
if (vec $ipnum, $depth ^ 7, 1) { } 15 113 128
if ($x1 >= $gi->{"databaseSegments"}) 0 15 15
if ($x0 >= $gi->{"databaseSegments"}) 3 110 113
if ($i < 20) 70 1 71
if ($delim eq "\377\377\377") { } 10 60 70
if $database_type >= 106 0 10 10
if ($gi->{'databaseType'} == 7) { } 0 10 10
elsif ($gi->{'databaseType'} == 3) { } 1 9 10
elsif ($gi->{'databaseType'} == 6 or $gi->{'databaseType'} == 2 or $gi->{'databaseType'} == 31 or $gi->{'databaseType'} == 30 or $gi->{'databaseType'} == 5 or $gi->{'databaseType'} == 11 or $gi->{'databaseType'} == 9 or $gi->{'databaseType'} == 21 or $gi->{'databaseType'} == 32 or $gi->{'databaseType'} == 4) { } 8 1 9
if ($j < 3) 24 8 32
if ($gi->{"databaseType"} == 5 or $gi->{"databaseType"} == 4 or $gi->{"databaseType"} == 11) 4 4 8
if ($gi->{"databaseType"} == 1 or $gi->{"databaseType"} == 12 or $gi->{"databaseType"} == 10) 2 9 11
unless $ip_address =~ /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/ 0 0 0
unless $ip_address =~ /^(?:\d{1,3}\.){3}\d{1,3}$/ 0 1 1
unless $ip_address =~ /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/ 0 1 1
if ($i < 20) 0 0 0
if ($buf eq "\377\377\377") 0 0 0
if ($hasStructureInfo == 1) { } 0 0 0
if ($i < 100) 0 0 0
if ($buf eq "\0\0\0") 0 0 0
unless $ip_address 0 1 1
if $seek == $gi->{"databaseSegments"} 0 1 1
defined $gir{'latitude'} ? : 1 0 1
defined $gir{'latitude'} ? : 0 0 0
unless $ip_address 0 0 0
if $seek == $gi->{"databaseSegments"} 0 0 0
if ($host =~ /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/) { } 2 0 2
if $host =~ /:/ 3 0 3
$err ? : 0 3 3
unless $ip_address =~ /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/ 0 2 2
unless $addr 0 1 1
if ($host =~ /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/) { } 0 0 0
unless $ip_address 0 0 0
unless $addr 0 0 0
if ($^O eq 'NetWare') { } 0 0 0
elsif ($^O eq 'MSWin32') { } 0 0 0
if (not defined $db_file) { } 0 0 0
elsif ($db_file =~ /^\d+$/) { } 0 0 0
unless @_ > 1 and $_[1] 0 11 11
CORE::open $fh, "$db_file" or die "Error opening $db_file" 11 0 11
if ($flags and $flags & 9) { } 0 11 11
if ($flags & 8) { } 0 0 0
unless defined $Sys::Mmap::VERSION 0 0 0
mmap($self{"buf"} = undef, 0, PROT_READ(), MAP_PRIVATE(), $fh) or die "mmap: $!" 0 0 0
if $type >= 106 0 0 0
unless $name 0 0 0
defined $Geo::IP::PP_OPEN_TYPE_PATH ? : 0 0 0
$^O eq 'NetWare' ? : 0 0 0
$^O eq 'MSWin32' ? : 0 0 0
unless $addr 0 2 2
if ($left_seek_num != 0 and $c == $gi->_seek_country($left_seek_num - 1)) 0 0 0
if ($right_seek_num != 4294967295 and $c == $gi->_seek_country($right_seek_num + 1)) 0 0 0
unless $ip_address 0 1 1
if ($gi->{'databaseType'} == 7) { } 0 1 1
elsif ($gi->{'databaseType'} == 3) { } 1 0 1
if ($seek_region >= 1000) { } 0 0 0
if ($seek_region < 1) { } 0 1 1
elsif ($seek_region < 677) { } 1 0 1
elsif ($seek_region < 1353) { } 0 0 0
$a2 ? : 0 0 0
unless defined &Geo::IP::open 7 0 7
Condition57%34/59
exists $gi->{"buf"} and $gi->{"flags"} and $gi->{"flags"} & 8
!ll&&!rl&&r
1100
exists $gi->{"buf"} and $gi->{"flags"}
!ll&&!rl&&r
1100
$gi->{"databaseType"} == 6 or $gi->{"databaseType"} == 2 or $gi->{"databaseType"} == 31 or $gi->{"databaseType"} == 30 or $gi->{"databaseType"} == 5 or $gi->{"databaseType"} == 11 or $gi->{"databaseType"} == 9 or $gi->{"databaseType"} == 21 or $gi->{"databaseType"} == 32 or $gi->{"databaseType"} == 4
l!l&&r!l&&!r
801
$gi->{"databaseType"} == 6 or $gi->{"databaseType"} == 2 or $gi->{"databaseType"} == 31 or $gi->{"databaseType"} == 30 or $gi->{"databaseType"} == 5 or $gi->{"databaseType"} == 11 or $gi->{"databaseType"} == 9 or $gi->{"databaseType"} == 21 or $gi->{"databaseType"} == 32
l!l&&r!l&&!r
711
$gi->{"databaseType"} == 6 or $gi->{"databaseType"} == 2 or $gi->{"databaseType"} == 31 or $gi->{"databaseType"} == 30 or $gi->{"databaseType"} == 5 or $gi->{"databaseType"} == 11 or $gi->{"databaseType"} == 9 or $gi->{"databaseType"} == 21
l!l&&r!l&&!r
522
$gi->{"databaseType"} == 6 or $gi->{"databaseType"} == 2 or $gi->{"databaseType"} == 31 or $gi->{"databaseType"} == 30 or $gi->{"databaseType"} == 5 or $gi->{"databaseType"} == 11 or $gi->{"databaseType"} == 9
l!l&&r!l&&!r
504
$gi->{"databaseType"} == 6 or $gi->{"databaseType"} == 2 or $gi->{"databaseType"} == 31 or $gi->{"databaseType"} == 30 or $gi->{"databaseType"} == 5 or $gi->{"databaseType"} == 11
l!l&&r!l&&!r
504
$gi->{"databaseType"} == 6 or $gi->{"databaseType"} == 2 or $gi->{"databaseType"} == 31 or $gi->{"databaseType"} == 30 or $gi->{"databaseType"} == 5
l!l&&r!l&&!r
144
$gi->{"databaseType"} == 6 or $gi->{"databaseType"} == 2 or $gi->{"databaseType"} == 31 or $gi->{"databaseType"} == 30
l!l&&r!l&&!r
108
$gi->{"databaseType"} == 6 or $gi->{"databaseType"} == 2 or $gi->{"databaseType"} == 31
l!l&&r!l&&!r
108
$gi->{"databaseType"} == 6 or $gi->{"databaseType"} == 2
l!l&&r!l&&!r
018
$gi->{"databaseType"} == 5 or $gi->{"databaseType"} == 4 or $gi->{"databaseType"} == 11
l!l&&r!l&&!r
404
$gi->{"databaseType"} == 5 or $gi->{"databaseType"} == 4
l!l&&r!l&&!r
404
$gi->{"databaseType"} == 1 or $gi->{"databaseType"} == 12 or $gi->{"databaseType"} == 10
l!l&&r!l&&!r
209
$gi->{"databaseType"} == 1 or $gi->{"databaseType"} == 12
l!l&&r!l&&!r
119
$_id_by_code{$_[1]} || 0
l!l
00
@_ > 1 and $_[1]
!ll&&!rl&&r
0011
$flags and $flags & 9
!ll&&!rl&&r
1100
$left_seek_num != 0 and $c == $gi->_seek_country($left_seek_num - 1)
!ll&&!rl&&r
000
$right_seek_num != 4294967295 and $c == $gi->_seek_country($right_seek_num + 1)
!ll&&!rl&&r
000
MC/DC0%0/3
exists $gi->{"buf"} and $gi->{"flags"} and $gi->{"flags"} & 8
exists $gi->{"buf"} $gi->{"flags"} $gi->{"flags"} & 8
MC/DC40%4/10
$gi->{"databaseType"} == 6 or $gi->{"databaseType"} == 2 or $gi->{"databaseType"} == 31 or $gi->{"databaseType"} == 30 or $gi->{"databaseType"} == 5 or $gi->{"databaseType"} == 11 or $gi->{"databaseType"} == 9 or $gi->{"databaseType"} == 21 or $gi->{"databaseType"} == 32 or $gi->{"databaseType"} == 4
$gi->{"databaseType"} == 6 $gi->{"databaseType"} == 2 $gi->{"databaseType"} == 31 $gi->{"databaseType"} == 30 $gi->{"databaseType"} == 5 $gi->{"databaseType"} == 11 $gi->{"databaseType"} == 9 $gi->{"databaseType"} == 21 $gi->{"databaseType"} == 32 $gi->{"databaseType"} == 4
MC/DC33%1/3
$gi->{"databaseType"} == 5 or $gi->{"databaseType"} == 4 or $gi->{"databaseType"} == 11
$gi->{"databaseType"} == 5 $gi->{"databaseType"} == 4 $gi->{"databaseType"} == 11
MC/DC66%2/3
$gi->{"databaseType"} == 1 or $gi->{"databaseType"} == 12 or $gi->{"databaseType"} == 10
$gi->{"databaseType"} == 1 $gi->{"databaseType"} == 12 $gi->{"databaseType"} == 10
MC/DC0%0/1
$_id_by_code{$_[1]} || 0
$_id_by_code{$_[1]}
MC/DC0%0/2
@_ > 1 and $_[1]
@_ > 1 $_[1]
MC/DC0%0/2
$flags and $flags & 9
$flags $flags & 9
MC/DC0%0/2
$left_seek_num != 0 and $c == $gi->_seek_country($left_seek_num - 1)
$left_seek_num != 0 $c == $gi->_seek_country($left_seek_num - 1)
MC/DC0%0/2
$right_seek_num != 4294967295 and $c == $gi->_seek_country($right_seek_num + 1)
$right_seek_num != 4294967295 $c == $gi->_seek_country($right_seek_num + 1)
Truth table25%1/4
A and B and C
A= exists $gi->{"buf"}B= $gi->{"flags"}C= $gi->{"flags"} & 8
ABCresult
0XX0
10X0
1100
1111
Truth table45%5/11
A or B or C or D or E or F or G or H or I or J
A= $gi->{"databaseType"} == 6B= $gi->{"databaseType"} == 2C= $gi->{"databaseType"} == 31D= $gi->{"databaseType"} == 30E= $gi->{"databaseType"} == 5F= $gi->{"databaseType"} == 11G= $gi->{"databaseType"} == 9H= $gi->{"databaseType"} == 21I= $gi->{"databaseType"} == 32J= $gi->{"databaseType"} == 4
ABCDEFGHIJresult
1XXXXXXXXX1
01XXXXXXXX1
001XXXXXXX1
0001XXXXXX1
00001XXXXX1
000001XXXX1
0000001XXX1
00000001XX1
000000001X1
00000000011
00000000000
Truth table50%2/4
A or B or C
A= $gi->{"databaseType"} == 5B= $gi->{"databaseType"} == 4C= $gi->{"databaseType"} == 11
ABCresult
1XX1
01X1
0011
0000
Truth table75%3/4
A or B or C
A= $gi->{"databaseType"} == 1B= $gi->{"databaseType"} == 12C= $gi->{"databaseType"} == 10
ABCresult
1XX1
01X1
0011
0000
Truth table0%0/2
A
A= $_id_by_code{$_[1]}
Aresult
11
00
Truth table33%1/3
A and B
A= @_ > 1B= $_[1]
ABresult
0X0
100
111
Truth table33%1/3
A and B
A= $flagsB= $flags & 9
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= $left_seek_num != 0B= $c == $gi->_seek_country($left_seek_num - 1)
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= $right_seek_num != 4294967295B= $c == $gi->_seek_country($right_seek_num + 1)
ABresult
0X0
100
111
123 package Geo::IP;
124  
125 use strict;
126  
127 use base qw(Exporter);
128  
129 our $VERSION;
130  
131 our @ISA;
132  
133 our $GEOIP_PP_ONLY = 0;
134 our $XS_VERSION;
135  
136 our @EXPORT = qw(
137 GEOIP_STANDARD GEOIP_MEMORY_CACHE
138 GEOIP_CHECK_CACHE GEOIP_INDEX_CACHE
139 GEOIP_UNKNOWN_SPEED GEOIP_DIALUP_SPEED
140 GEOIP_CABLEDSL_SPEED GEOIP_CORPORATE_SPEED
141 GEOIP_COUNTRY_EDITION GEOIP_REGION_EDITION_REV0
142 GEOIP_CITY_EDITION_REV0 GEOIP_ORG_EDITION
143 GEOIP_ISP_EDITION GEOIP_CITY_EDITION_REV1
144 GEOIP_REGION_EDITION_REV1 GEOIP_PROXY_EDITION
145 GEOIP_ASNUM_EDITION GEOIP_NETSPEED_EDITION
146 GEOIP_CHARSET_ISO_8859_1 GEOIP_CHARSET_UTF8
147 GEOIP_MMAP_CACHE GEOIP_ACCURACYRADIUS_EDITION
148 GEOIP_COUNTRY_EDITION_V6 GEOIP_DOMAIN_EDITION
149 GEOIP_NETSPEED_EDITION_REV1 GEOIP_SILENCE
150 );
151  
152 use strict;
153 use FileHandle;
154 use File::Spec;
155  
156 require bytes;
157  
158 BEGIN {
159 if ( $] >= 5.008 ) {
160 require Encode;
161 Encode->import(qw/ decode /);
162 }
163 else {
164 *decode = sub {
165 local $_ = $_[1];
166 use bytes;
167 s/([\x80-\xff])/my $c = ord($1);
168 my $p = $c >= 192 ? 1 : 0;
169 pack ( 'CC' => 0xc2 + $p , $c & ~0x40 ); /ge;
170 return $_;
171 };
172 }
173 }
174  
175 use vars qw/$PP_OPEN_TYPE_PATH/;
176  
177 use constant FULL_RECORD_LENGTH => 50;
178 use constant GEOIP_COUNTRY_BEGIN => 16776960;
179 use constant RECORD_LENGTH => 3;
180 use constant GEOIP_STATE_BEGIN_REV0 => 16700000;
181 use constant GEOIP_STATE_BEGIN_REV1 => 16000000;
182 use constant STRUCTURE_INFO_MAX_SIZE => 20;
183 use constant DATABASE_INFO_MAX_SIZE => 100;
184  
185 use constant SEGMENT_RECORD_LENGTH => 3;
186 use constant STANDARD_RECORD_LENGTH => 3;
187 use constant ORG_RECORD_LENGTH => 4;
188 use constant MAX_RECORD_LENGTH => 4;
189 use constant MAX_ORG_RECORD_LENGTH => 300;
190 use constant US_OFFSET => 1;
191 use constant CANADA_OFFSET => 677;
192 use constant WORLD_OFFSET => 1353;
193 use constant FIPS_RANGE => 360;
194  
195 my @continents = qw/
196 --
197 AS EU EU AS AS NA NA EU AS NA
198 AF AN SA OC EU OC NA AS EU NA
199 AS EU AF EU AS AF AF NA AS SA
200 SA NA AS AN AF EU NA NA AS AF
201 AF AF EU AF OC SA AF AS SA NA
202 NA AF AS AS EU EU AF EU NA NA
203 AF SA EU AF AF AF EU AF EU OC
204 SA OC EU EU EU AF EU NA AS SA
205 AF EU NA AF AF NA AF EU AN NA
206 OC AF SA AS AN NA EU NA EU AS
207 EU AS AS AS AS AS EU EU NA AS
208 AS AF AS AS OC AF NA AS AS AS
209 NA AS AS AS NA EU AS AF AF EU
210 EU EU AF AF EU EU AF OC EU AF
211 AS AS AS OC NA AF NA EU AF AS
212 AF NA AS AF AF OC AF OC AF NA
213 EU EU AS OC OC OC AS NA SA OC
214 OC AS AS EU NA OC NA AS EU OC
215 SA AS AF EU EU AF AS OC AF AF
216 EU AS AF EU EU EU AF EU AF AF
217 SA AF NA AS AF NA AF AN AF AS
218 AS OC AS AF OC AS EU NA OC AS
219 AF EU AF OC NA SA AS EU NA SA
220 NA NA AS OC OC OC AS AF EU AF
221 AF EU AF -- -- -- EU EU EU EU
222 NA NA NA AF
223 /;
224  
225 my @countries = (
226 undef, qw/
227 AP EU AD AE AF AG AI
228 AL AM CW AO AQ AR AS AT
229 AU AW AZ BA BB BD BE BF
230 BG BH BI BJ BM BN BO BR
231 BS BT BV BW BY BZ CA CC
232 CD CF CG CH CI CK CL CM
233 CN CO CR CU CV CX CY CZ
234 DE DJ DK DM DO DZ EC EE
235 EG EH ER ES ET FI FJ FK
236 FM FO FR FX GA GB GD GE
237 GF GH GI GL GM GN GP GQ
238 GR GS GT GU GW GY HK HM
239 HN HR HT HU ID IE IL IN
240 IO IQ IR IS IT JM JO JP
241 KE KG KH KI KM KN KP KR
242 KW KY KZ LA LB LC LI LK
243 LR LS LT LU LV LY MA MC
244 MD MG MH MK ML MM MN MO
245 MP MQ MR MS MT MU MV MW
246 MX MY MZ NA NC NE NF NG
247 NI NL NO NP NR NU NZ OM
248 PA PE PF PG PH PK PL PM
249 PN PR PS PT PW PY QA RE
250 RO RU RW SA SB SC SD SE
251 SG SH SI SJ SK SL SM SN
252 SO SR ST SV SY SZ TC TD
253 TF TG TH TJ TK TM TN TO
254 TL TR TT TV TW TZ UA UG
255 UM US UY UZ VA VC VE VG
256 VI VN VU WF WS YE YT RS
257 ZA ZM ME ZW A1 A2 O1 AX
258 GG IM JE BL MF BQ SS O1 /
259 );
260  
261 my %_id_by_code;
262 for ( 1 .. $#countries ) {
263 $_id_by_code{ $countries[$_] } = $_;
264 }
265  
266 my @code3s = (
267 undef, qw/
268 AP EU AND ARE AFG ATG AIA
269 ALB ARM CUW AGO ATA ARG ASM AUT
270 AUS ABW AZE BIH BRB BGD BEL BFA
271 BGR BHR BDI BEN BMU BRN BOL BRA
272 BHS BTN BVT BWA BLR BLZ CAN CCK
273 COD CAF COG CHE CIV COK CHL CMR
274 CHN COL CRI CUB CPV CXR CYP CZE
275 DEU DJI DNK DMA DOM DZA ECU EST
276 EGY ESH ERI ESP ETH FIN FJI FLK
277 FSM FRO FRA FX GAB GBR GRD GEO
278 GUF GHA GIB GRL GMB GIN GLP GNQ
279 GRC SGS GTM GUM GNB GUY HKG HMD
280 HND HRV HTI HUN IDN IRL ISR IND
281 IOT IRQ IRN ISL ITA JAM JOR JPN
282 KEN KGZ KHM KIR COM KNA PRK KOR
283 KWT CYM KAZ LAO LBN LCA LIE LKA
284 LBR LSO LTU LUX LVA LBY MAR MCO
285 MDA MDG MHL MKD MLI MMR MNG MAC
286 MNP MTQ MRT MSR MLT MUS MDV MWI
287 MEX MYS MOZ NAM NCL NER NFK NGA
288 NIC NLD NOR NPL NRU NIU NZL OMN
289 PAN PER PYF PNG PHL PAK POL SPM
290 PCN PRI PSE PRT PLW PRY QAT REU
291 ROU RUS RWA SAU SLB SYC SDN SWE
292 SGP SHN SVN SJM SVK SLE SMR SEN
293 SOM SUR STP SLV SYR SWZ TCA TCD
294 ATF TGO THA TJK TKL TKM TUN TON
295 TLS TUR TTO TUV TWN TZA UKR UGA
296 UMI USA URY UZB VAT VCT VEN VGB
297 VIR VNM VUT WLF WSM YEM MYT SRB
298 ZAF ZMB MNE ZWE A1 A2 O1 ALA
299 GGY IMN JEY BLM MAF BES SSD O1 /
300 );
301 my @names = (
302 undef,
303 "Asia/Pacific Region",
304 "Europe",
305 "Andorra",
306 "United Arab Emirates",
307 "Afghanistan",
308 "Antigua and Barbuda",
309 "Anguilla",
310 "Albania",
311 "Armenia",
312 "Curacao",
313 "Angola",
314 "Antarctica",
315 "Argentina",
316 "American Samoa",
317 "Austria",
318 "Australia",
319 "Aruba",
320 "Azerbaijan",
321 "Bosnia and Herzegovina",
322 "Barbados",
323 "Bangladesh",
324 "Belgium",
325 "Burkina Faso",
326 "Bulgaria",
327 "Bahrain",
328 "Burundi",
329 "Benin",
330 "Bermuda",
331 "Brunei Darussalam",
332 "Bolivia",
333 "Brazil",
334 "Bahamas",
335 "Bhutan",
336 "Bouvet Island",
337 "Botswana",
338 "Belarus",
339 "Belize",
340 "Canada",
341 "Cocos (Keeling) Islands",
342 "Congo, The Democratic Republic of the",
343 "Central African Republic",
344 "Congo",
345 "Switzerland",
346 "Cote D'Ivoire",
347 "Cook Islands",
348 "Chile",
349 "Cameroon",
350 "China",
351 "Colombia",
352 "Costa Rica",
353 "Cuba",
354 "Cape Verde",
355 "Christmas Island",
356 "Cyprus",
357 "Czech Republic",
358 "Germany",
359 "Djibouti",
360 "Denmark",
361 "Dominica",
362 "Dominican Republic",
363 "Algeria",
364 "Ecuador",
365 "Estonia",
366 "Egypt",
367 "Western Sahara",
368 "Eritrea",
369 "Spain",
370 "Ethiopia",
371 "Finland",
372 "Fiji",
373 "Falkland Islands (Malvinas)",
374 "Micronesia, Federated States of",
375 "Faroe Islands",
376 "France",
377 "France, Metropolitan",
378 "Gabon",
379 "United Kingdom",
380 "Grenada",
381 "Georgia",
382 "French Guiana",
383 "Ghana",
384 "Gibraltar",
385 "Greenland",
386 "Gambia",
387 "Guinea",
388 "Guadeloupe",
389 "Equatorial Guinea",
390 "Greece",
391 "South Georgia and the South Sandwich Islands",
392 "Guatemala",
393 "Guam",
394 "Guinea-Bissau",
395 "Guyana",
396 "Hong Kong",
397 "Heard Island and McDonald Islands",
398 "Honduras",
399 "Croatia",
400 "Haiti",
401 "Hungary",
402 "Indonesia",
403 "Ireland",
404 "Israel",
405 "India",
406 "British Indian Ocean Territory",
407 "Iraq",
408 "Iran, Islamic Republic of",
409 "Iceland",
410 "Italy",
411 "Jamaica",
412 "Jordan",
413 "Japan",
414 "Kenya",
415 "Kyrgyzstan",
416 "Cambodia",
417 "Kiribati",
418 "Comoros",
419 "Saint Kitts and Nevis",
420 "Korea, Democratic People's Republic of",
421 "Korea, Republic of",
422 "Kuwait",
423 "Cayman Islands",
424 "Kazakhstan",
425 "Lao People's Democratic Republic",
426 "Lebanon",
427 "Saint Lucia",
428 "Liechtenstein",
429 "Sri Lanka",
430 "Liberia",
431 "Lesotho",
432 "Lithuania",
433 "Luxembourg",
434 "Latvia",
435 "Libya",
436 "Morocco",
437 "Monaco",
438 "Moldova, Republic of",
439 "Madagascar",
440 "Marshall Islands",
441 "Macedonia",
442 "Mali",
443 "Myanmar",
444 "Mongolia",
445 "Macau",
446 "Northern Mariana Islands",
447 "Martinique",
448 "Mauritania",
449 "Montserrat",
450 "Malta",
451 "Mauritius",
452 "Maldives",
453 "Malawi",
454 "Mexico",
455 "Malaysia",
456 "Mozambique",
457 "Namibia",
458 "New Caledonia",
459 "Niger",
460 "Norfolk Island",
461 "Nigeria",
462 "Nicaragua",
463 "Netherlands",
464 "Norway",
465 "Nepal",
466 "Nauru",
467 "Niue",
468 "New Zealand",
469 "Oman",
470 "Panama",
471 "Peru",
472 "French Polynesia",
473 "Papua New Guinea",
474 "Philippines",
475 "Pakistan",
476 "Poland",
477 "Saint Pierre and Miquelon",
478 "Pitcairn Islands",
479 "Puerto Rico",
480 "Palestinian Territory",
481 "Portugal",
482 "Palau",
483 "Paraguay",
484 "Qatar",
485 "Reunion",
486 "Romania",
487 "Russian Federation",
488 "Rwanda",
489 "Saudi Arabia",
490 "Solomon Islands",
491 "Seychelles",
492 "Sudan",
493 "Sweden",
494 "Singapore",
495 "Saint Helena",
496 "Slovenia",
497 "Svalbard and Jan Mayen",
498 "Slovakia",
499 "Sierra Leone",
500 "San Marino",
501 "Senegal",
502 "Somalia",
503 "Suriname",
504 "Sao Tome and Principe",
505 "El Salvador",
506 "Syrian Arab Republic",
507 "Swaziland",
508 "Turks and Caicos Islands",
509 "Chad",
510 "French Southern Territories",
511 "Togo",
512 "Thailand",
513 "Tajikistan",
514 "Tokelau",
515 "Turkmenistan",
516 "Tunisia",
517 "Tonga",
518 "Timor-Leste",
519 "Turkey",
520 "Trinidad and Tobago",
521 "Tuvalu",
522 "Taiwan",
523 "Tanzania, United Republic of",
524 "Ukraine",
525 "Uganda",
526 "United States Minor Outlying Islands",
527 "United States",
528 "Uruguay",
529 "Uzbekistan",
530 "Holy See (Vatican City State)",
531 "Saint Vincent and the Grenadines",
532 "Venezuela",
533 "Virgin Islands, British",
534 "Virgin Islands, U.S.",
535 "Vietnam",
536 "Vanuatu",
537 "Wallis and Futuna",
538 "Samoa",
539 "Yemen",
540 "Mayotte",
541 "Serbia",
542 "South Africa",
543 "Zambia",
544 "Montenegro",
545 "Zimbabwe",
546 "Anonymous Proxy",
547 "Satellite Provider",
548 "Other",
549 "Aland Islands",
550 "Guernsey",
551 "Isle of Man",
552 "Jersey",
553 "Saint Barthelemy",
554 "Saint Martin",
555 "Bonaire, Saint Eustatius and Saba",
556 "South Sudan",
557 "Other"
558 );
559  
560 my %country_region_names = (
561 'AD' => {
562 '02' => 'Canillo',
563 '03' => 'Encamp',
564 '04' => 'La Massana',
565 '05' => 'Ordino',
566 '06' => 'Sant Julia de Loria',
567 '07' => 'Andorra la Vella',
568 '08' => 'Escaldes-Engordany'
569 },
570 'AE' => {
571 '01' => 'Abu Dhabi',
572 '02' => 'Ajman',
573 '03' => 'Dubai',
574 '04' => 'Fujairah',
575 '05' => 'Ras Al Khaimah',
576 '06' => 'Sharjah',
577 '07' => 'Umm Al Quwain'
578 },
579 'AF' => {
580 '01' => 'Badakhshan',
581 '02' => 'Badghis',
582 '03' => 'Baghlan',
583 '05' => 'Bamian',
584 '06' => 'Farah',
585 '07' => 'Faryab',
586 '08' => 'Ghazni',
587 '09' => 'Ghowr',
588 '10' => 'Helmand',
589 '11' => 'Herat',
590 '13' => 'Kabol',
591 '14' => 'Kapisa',
592 '17' => 'Lowgar',
593 '18' => 'Nangarhar',
594 '19' => 'Nimruz',
595 '23' => 'Kandahar',
596 '24' => 'Kondoz',
597 '26' => 'Takhar',
598 '27' => 'Vardak',
599 '28' => 'Zabol',
600 '29' => 'Paktika',
601 '30' => 'Balkh',
602 '31' => 'Jowzjan',
603 '32' => 'Samangan',
604 '33' => 'Sar-e Pol',
605 '34' => 'Konar',
606 '35' => 'Laghman',
607 '36' => 'Paktia',
608 '37' => 'Khowst',
609 '38' => 'Nurestan',
610 '39' => 'Oruzgan',
611 '40' => 'Parvan',
612 '41' => 'Daykondi',
613 '42' => 'Panjshir'
614 },
615 'AG' => {
616 '01' => 'Barbuda',
617 '03' => 'Saint George',
618 '04' => 'Saint John',
619 '05' => 'Saint Mary',
620 '06' => 'Saint Paul',
621 '07' => 'Saint Peter',
622 '08' => 'Saint Philip',
623 '09' => 'Redonda'
624 },
625 'AL' => {
626 '40' => 'Berat',
627 '41' => 'Diber',
628 '42' => 'Durres',
629 '43' => 'Elbasan',
630 '44' => 'Fier',
631 '45' => 'Gjirokaster',
632 '46' => 'Korce',
633 '47' => 'Kukes',
634 '48' => 'Lezhe',
635 '49' => 'Shkoder',
636 '50' => 'Tirane',
637 '51' => 'Vlore'
638 },
639 'AM' => {
640 '01' => 'Aragatsotn',
641 '02' => 'Ararat',
642 '03' => 'Armavir',
643 '04' => 'Geghark\'unik\'',
644 '05' => 'Kotayk\'',
645 '06' => 'Lorri',
646 '07' => 'Shirak',
647 '08' => 'Syunik\'',
648 '09' => 'Tavush',
649 '10' => 'Vayots\' Dzor',
650 '11' => 'Yerevan'
651 },
652 'AO' => {
653 '01' => 'Benguela',
654 '02' => 'Bie',
655 '03' => 'Cabinda',
656 '04' => 'Cuando Cubango',
657 '05' => 'Cuanza Norte',
658 '06' => 'Cuanza Sul',
659 '07' => 'Cunene',
660 '08' => 'Huambo',
661 '09' => 'Huila',
662 '12' => 'Malanje',
663 '13' => 'Namibe',
664 '14' => 'Moxico',
665 '15' => 'Uige',
666 '16' => 'Zaire',
667 '17' => 'Lunda Norte',
668 '18' => 'Lunda Sul',
669 '19' => 'Bengo',
670 '20' => 'Luanda'
671 },
672 'AR' => {
673 '01' => 'Buenos Aires',
674 '02' => 'Catamarca',
675 '03' => 'Chaco',
676 '04' => 'Chubut',
677 '05' => 'Cordoba',
678 '06' => 'Corrientes',
679 '07' => 'Distrito Federal',
680 '08' => 'Entre Rios',
681 '09' => 'Formosa',
682 '10' => 'Jujuy',
683 '11' => 'La Pampa',
684 '12' => 'La Rioja',
685 '13' => 'Mendoza',
686 '14' => 'Misiones',
687 '15' => 'Neuquen',
688 '16' => 'Rio Negro',
689 '17' => 'Salta',
690 '18' => 'San Juan',
691 '19' => 'San Luis',
692 '20' => 'Santa Cruz',
693 '21' => 'Santa Fe',
694 '22' => 'Santiago del Estero',
695 '23' => 'Tierra del Fuego',
696 '24' => 'Tucuman'
697 },
698 'AT' => {
699 '01' => 'Burgenland',
700 '02' => 'Karnten',
701 '03' => 'Niederosterreich',
702 '04' => 'Oberosterreich',
703 '05' => 'Salzburg',
704 '06' => 'Steiermark',
705 '07' => 'Tirol',
706 '08' => 'Vorarlberg',
707 '09' => 'Wien'
708 },
709 'AU' => {
710 '01' => 'Australian Capital Territory',
711 '02' => 'New South Wales',
712 '03' => 'Northern Territory',
713 '04' => 'Queensland',
714 '05' => 'South Australia',
715 '06' => 'Tasmania',
716 '07' => 'Victoria',
717 '08' => 'Western Australia'
718 },
719 'AZ' => {
720 '01' => 'Abseron',
721 '02' => 'Agcabadi',
722 '03' => 'Agdam',
723 '04' => 'Agdas',
724 '05' => 'Agstafa',
725 '06' => 'Agsu',
726 '07' => 'Ali Bayramli',
727 '08' => 'Astara',
728 '09' => 'Baki',
729 '10' => 'Balakan',
730 '11' => 'Barda',
731 '12' => 'Beylaqan',
732 '13' => 'Bilasuvar',
733 '14' => 'Cabrayil',
734 '15' => 'Calilabad',
735 '16' => 'Daskasan',
736 '17' => 'Davaci',
737 '18' => 'Fuzuli',
738 '19' => 'Gadabay',
739 '20' => 'Ganca',
740 '21' => 'Goranboy',
741 '22' => 'Goycay',
742 '23' => 'Haciqabul',
743 '24' => 'Imisli',
744 '25' => 'Ismayilli',
745 '26' => 'Kalbacar',
746 '27' => 'Kurdamir',
747 '28' => 'Lacin',
748 '29' => 'Lankaran',
749 '30' => 'Lankaran',
750 '31' => 'Lerik',
751 '32' => 'Masalli',
752 '33' => 'Mingacevir',
753 '34' => 'Naftalan',
754 '35' => 'Naxcivan',
755 '36' => 'Neftcala',
756 '37' => 'Oguz',
757 '38' => 'Qabala',
758 '39' => 'Qax',
759 '40' => 'Qazax',
760 '41' => 'Qobustan',
761 '42' => 'Quba',
762 '43' => 'Qubadli',
763 '44' => 'Qusar',
764 '45' => 'Saatli',
765 '46' => 'Sabirabad',
766 '47' => 'Saki',
767 '48' => 'Saki',
768 '49' => 'Salyan',
769 '50' => 'Samaxi',
770 '51' => 'Samkir',
771 '52' => 'Samux',
772 '53' => 'Siyazan',
773 '54' => 'Sumqayit',
774 '55' => 'Susa',
775 '56' => 'Susa',
776 '57' => 'Tartar',
777 '58' => 'Tovuz',
778 '59' => 'Ucar',
779 '60' => 'Xacmaz',
780 '61' => 'Xankandi',
781 '62' => 'Xanlar',
782 '63' => 'Xizi',
783 '64' => 'Xocali',
784 '65' => 'Xocavand',
785 '66' => 'Yardimli',
786 '67' => 'Yevlax',
787 '68' => 'Yevlax',
788 '69' => 'Zangilan',
789 '70' => 'Zaqatala',
790 '71' => 'Zardab'
791 },
792 'BA' => {
793 '01' => 'Federation of Bosnia and Herzegovina',
794 '02' => 'Republika Srpska',
795 '03' => 'Brcko District'
796 },
797 'BB' => {
798 '01' => 'Christ Church',
799 '02' => 'Saint Andrew',
800 '03' => 'Saint George',
801 '04' => 'Saint James',
802 '05' => 'Saint John',
803 '06' => 'Saint Joseph',
804 '07' => 'Saint Lucy',
805 '08' => 'Saint Michael',
806 '09' => 'Saint Peter',
807 '10' => 'Saint Philip',
808 '11' => 'Saint Thomas'
809 },
810 'BD' => {
811 '81' => 'Dhaka',
812 '82' => 'Khulna',
813 '83' => 'Rajshahi',
814 '84' => 'Chittagong',
815 '85' => 'Barisal',
816 '86' => 'Sylhet',
817 '87' => 'Rangpur'
818 },
819 'BE' => {
820 '01' => 'Antwerpen',
821 '03' => 'Hainaut',
822 '04' => 'Liege',
823 '05' => 'Limburg',
824 '06' => 'Luxembourg',
825 '07' => 'Namur',
826 '08' => 'Oost-Vlaanderen',
827 '09' => 'West-Vlaanderen',
828 '10' => 'Brabant Wallon',
829 '11' => 'Brussels Hoofdstedelijk Gewest',
830 '12' => 'Vlaams-Brabant',
831 '13' => 'Flanders',
832 '14' => 'Wallonia'
833 },
834 'BF' => {
835 '15' => 'Bam',
836 '19' => 'Boulkiemde',
837 '20' => 'Ganzourgou',
838 '21' => 'Gnagna',
839 '28' => 'Kouritenga',
840 '33' => 'Oudalan',
841 '34' => 'Passore',
842 '36' => 'Sanguie',
843 '40' => 'Soum',
844 '42' => 'Tapoa',
845 '44' => 'Zoundweogo',
846 '45' => 'Bale',
847 '46' => 'Banwa',
848 '47' => 'Bazega',
849 '48' => 'Bougouriba',
850 '49' => 'Boulgou',
851 '50' => 'Gourma',
852 '51' => 'Houet',
853 '52' => 'Ioba',
854 '53' => 'Kadiogo',
855 '54' => 'Kenedougou',
856 '55' => 'Komoe',
857 '56' => 'Komondjari',
858 '57' => 'Kompienga',
859 '58' => 'Kossi',
860 '59' => 'Koulpelogo',
861 '60' => 'Kourweogo',
862 '61' => 'Leraba',
863 '62' => 'Loroum',
864 '63' => 'Mouhoun',
865 '64' => 'Namentenga',
866 '65' => 'Naouri',
867 '66' => 'Nayala',
868 '67' => 'Noumbiel',
869 '68' => 'Oubritenga',
870 '69' => 'Poni',
871 '70' => 'Sanmatenga',
872 '71' => 'Seno',
873 '72' => 'Sissili',
874 '73' => 'Sourou',
875 '74' => 'Tuy',
876 '75' => 'Yagha',
877 '76' => 'Yatenga',
878 '77' => 'Ziro',
879 '78' => 'Zondoma'
880 },
881 'BG' => {
882 '33' => 'Mikhaylovgrad',
883 '38' => 'Blagoevgrad',
884 '39' => 'Burgas',
885 '40' => 'Dobrich',
886 '41' => 'Gabrovo',
887 '42' => 'Grad Sofiya',
888 '43' => 'Khaskovo',
889 '44' => 'Kurdzhali',
890 '45' => 'Kyustendil',
891 '46' => 'Lovech',
892 '47' => 'Montana',
893 '48' => 'Pazardzhik',
894 '49' => 'Pernik',
895 '50' => 'Pleven',
896 '51' => 'Plovdiv',
897 '52' => 'Razgrad',
898 '53' => 'Ruse',
899 '54' => 'Shumen',
900 '55' => 'Silistra',
901 '56' => 'Sliven',
902 '57' => 'Smolyan',
903 '58' => 'Sofiya',
904 '59' => 'Stara Zagora',
905 '60' => 'Turgovishte',
906 '61' => 'Varna',
907 '62' => 'Veliko Turnovo',
908 '63' => 'Vidin',
909 '64' => 'Vratsa',
910 '65' => 'Yambol'
911 },
912 'BH' => {
913 '01' => 'Al Hadd',
914 '02' => 'Al Manamah',
915 '05' => 'Jidd Hafs',
916 '06' => 'Sitrah',
917 '08' => 'Al Mintaqah al Gharbiyah',
918 '09' => 'Mintaqat Juzur Hawar',
919 '10' => 'Al Mintaqah ash Shamaliyah',
920 '11' => 'Al Mintaqah al Wusta',
921 '12' => 'Madinat',
922 '13' => 'Ar Rifa',
923 '14' => 'Madinat Hamad',
924 '15' => 'Al Muharraq',
925 '16' => 'Al Asimah',
926 '17' => 'Al Janubiyah',
927 '18' => 'Ash Shamaliyah',
928 '19' => 'Al Wusta'
929 },
930 'BI' => {
931 '02' => 'Bujumbura',
932 '09' => 'Bubanza',
933 '10' => 'Bururi',
934 '11' => 'Cankuzo',
935 '12' => 'Cibitoke',
936 '13' => 'Gitega',
937 '14' => 'Karuzi',
938 '15' => 'Kayanza',
939 '16' => 'Kirundo',
940 '17' => 'Makamba',
941 '18' => 'Muyinga',
942 '19' => 'Ngozi',
943 '20' => 'Rutana',
944 '21' => 'Ruyigi',
945 '22' => 'Muramvya',
946 '23' => 'Mwaro'
947 },
948 'BJ' => {
949 '07' => 'Alibori',
950 '08' => 'Atakora',
951 '09' => 'Atlanyique',
952 '10' => 'Borgou',
953 '11' => 'Collines',
954 '12' => 'Kouffo',
955 '13' => 'Donga',
956 '14' => 'Littoral',
957 '15' => 'Mono',
958 '16' => 'Oueme',
959 '17' => 'Plateau',
960 '18' => 'Zou'
961 },
962 'BM' => {
963 '01' => 'Devonshire',
964 '02' => 'Hamilton',
965 '03' => 'Hamilton',
966 '04' => 'Paget',
967 '05' => 'Pembroke',
968 '06' => 'Saint George',
969 '07' => 'Saint George\'s',
970 '08' => 'Sandys',
971 '09' => 'Smiths',
972 '10' => 'Southampton',
973 '11' => 'Warwick'
974 },
975 'BN' => {
976 '07' => 'Alibori',
977 '08' => 'Belait',
978 '09' => 'Brunei and Muara',
979 '10' => 'Temburong',
980 '11' => 'Collines',
981 '12' => 'Kouffo',
982 '13' => 'Donga',
983 '14' => 'Littoral',
984 '15' => 'Tutong',
985 '16' => 'Oueme',
986 '17' => 'Plateau',
987 '18' => 'Zou'
988 },
989 'BO' => {
990 '01' => 'Chuquisaca',
991 '02' => 'Cochabamba',
992 '03' => 'El Beni',
993 '04' => 'La Paz',
994 '05' => 'Oruro',
995 '06' => 'Pando',
996 '07' => 'Potosi',
997 '08' => 'Santa Cruz',
998 '09' => 'Tarija'
999 },
1000 'BR' => {
1001 '01' => 'Acre',
1002 '02' => 'Alagoas',
1003 '03' => 'Amapa',
1004 '04' => 'Amazonas',
1005 '05' => 'Bahia',
1006 '06' => 'Ceara',
1007 '07' => 'Distrito Federal',
1008 '08' => 'Espirito Santo',
1009 '11' => 'Mato Grosso do Sul',
1010 '13' => 'Maranhao',
1011 '14' => 'Mato Grosso',
1012 '15' => 'Minas Gerais',
1013 '16' => 'Para',
1014 '17' => 'Paraiba',
1015 '18' => 'Parana',
1016 '20' => 'Piaui',
1017 '21' => 'Rio de Janeiro',
1018 '22' => 'Rio Grande do Norte',
1019 '23' => 'Rio Grande do Sul',
1020 '24' => 'Rondonia',
1021 '25' => 'Roraima',
1022 '26' => 'Santa Catarina',
1023 '27' => 'Sao Paulo',
1024 '28' => 'Sergipe',
1025 '29' => 'Goias',
1026 '30' => 'Pernambuco',
1027 '31' => 'Tocantins'
1028 },
1029 'BS' => {
1030 '05' => 'Bimini',
1031 '06' => 'Cat Island',
1032 '10' => 'Exuma',
1033 '13' => 'Inagua',
1034 '15' => 'Long Island',
1035 '16' => 'Mayaguana',
1036 '18' => 'Ragged Island',
1037 '22' => 'Harbour Island',
1038 '23' => 'New Providence',
1039 '24' => 'Acklins and Crooked Islands',
1040 '25' => 'Freeport',
1041 '26' => 'Fresh Creek',
1042 '27' => 'Governor\'s Harbour',
1043 '28' => 'Green Turtle Cay',
1044 '29' => 'High Rock',
1045 '30' => 'Kemps Bay',
1046 '31' => 'Marsh Harbour',
1047 '32' => 'Nichollstown and Berry Islands',
1048 '33' => 'Rock Sound',
1049 '34' => 'Sandy Point',
1050 '35' => 'San Salvador and Rum Cay'
1051 },
1052 'BT' => {
1053 '05' => 'Bumthang',
1054 '06' => 'Chhukha',
1055 '07' => 'Chirang',
1056 '08' => 'Daga',
1057 '09' => 'Geylegphug',
1058 '10' => 'Ha',
1059 '11' => 'Lhuntshi',
1060 '12' => 'Mongar',
1061 '13' => 'Paro',
1062 '14' => 'Pemagatsel',
1063 '15' => 'Punakha',
1064 '16' => 'Samchi',
1065 '17' => 'Samdrup',
1066 '18' => 'Shemgang',
1067 '19' => 'Tashigang',
1068 '20' => 'Thimphu',
1069 '21' => 'Tongsa',
1070 '22' => 'Wangdi Phodrang'
1071 },
1072 'BW' => {
1073 '01' => 'Central',
1074 '03' => 'Ghanzi',
1075 '04' => 'Kgalagadi',
1076 '05' => 'Kgatleng',
1077 '06' => 'Kweneng',
1078 '08' => 'North-East',
1079 '09' => 'South-East',
1080 '10' => 'Southern',
1081 '11' => 'North-West'
1082 },
1083 'BY' => {
1084 '01' => 'Brestskaya Voblasts\'',
1085 '02' => 'Homyel\'skaya Voblasts\'',
1086 '03' => 'Hrodzyenskaya Voblasts\'',
1087 '04' => 'Minsk',
1088 '05' => 'Minskaya Voblasts\'',
1089 '06' => 'Mahilyowskaya Voblasts\'',
1090 '07' => 'Vitsyebskaya Voblasts\''
1091 },
1092 'BZ' => {
1093 '01' => 'Belize',
1094 '02' => 'Cayo',
1095 '03' => 'Corozal',
1096 '04' => 'Orange Walk',
1097 '05' => 'Stann Creek',
1098 '06' => 'Toledo'
1099 },
1100 'CA' => {
1101 'AB' => 'Alberta',
1102 'BC' => 'British Columbia',
1103 'MB' => 'Manitoba',
1104 'NB' => 'New Brunswick',
1105 'NL' => 'Newfoundland',
1106 'NS' => 'Nova Scotia',
1107 'NT' => 'Northwest Territories',
1108 'NU' => 'Nunavut',
1109 'ON' => 'Ontario',
1110 'PE' => 'Prince Edward Island',
1111 'QC' => 'Quebec',
1112 'SK' => 'Saskatchewan',
1113 'YT' => 'Yukon Territory'
1114 },
1115 'CD' => {
1116 '01' => 'Bandundu',
1117 '02' => 'Equateur',
1118 '04' => 'Kasai-Oriental',
1119 '05' => 'Katanga',
1120 '06' => 'Kinshasa',
1121 '08' => 'Bas-Congo',
1122 '09' => 'Orientale',
1123 '10' => 'Maniema',
1124 '11' => 'Nord-Kivu',
1125 '12' => 'Sud-Kivu'
1126 },
1127 'CF' => {
1128 '01' => 'Bamingui-Bangoran',
1129 '02' => 'Basse-Kotto',
1130 '03' => 'Haute-Kotto',
1131 '04' => 'Mambere-Kadei',
1132 '05' => 'Haut-Mbomou',
1133 '06' => 'Kemo',
1134 '07' => 'Lobaye',
1135 '08' => 'Mbomou',
1136 '09' => 'Nana-Mambere',
1137 '11' => 'Ouaka',
1138 '12' => 'Ouham',
1139 '13' => 'Ouham-Pende',
1140 '14' => 'Cuvette-Ouest',
1141 '15' => 'Nana-Grebizi',
1142 '16' => 'Sangha-Mbaere',
1143 '17' => 'Ombella-Mpoko',
1144 '18' => 'Bangui'
1145 },
1146 'CG' => {
1147 '01' => 'Bouenza',
1148 '04' => 'Kouilou',
1149 '05' => 'Lekoumou',
1150 '06' => 'Likouala',
1151 '07' => 'Niari',
1152 '08' => 'Plateaux',
1153 '10' => 'Sangha',
1154 '11' => 'Pool',
1155 '12' => 'Brazzaville',
1156 '13' => 'Cuvette',
1157 '14' => 'Cuvette-Ouest'
1158 },
1159 'CH' => {
1160 '01' => 'Aargau',
1161 '02' => 'Ausser-Rhoden',
1162 '03' => 'Basel-Landschaft',
1163 '04' => 'Basel-Stadt',
1164 '05' => 'Bern',
1165 '06' => 'Fribourg',
1166 '07' => 'Geneve',
1167 '08' => 'Glarus',
1168 '09' => 'Graubunden',
1169 '10' => 'Inner-Rhoden',
1170 '11' => 'Luzern',
1171 '12' => 'Neuchatel',
1172 '13' => 'Nidwalden',
1173 '14' => 'Obwalden',
1174 '15' => 'Sankt Gallen',
1175 '16' => 'Schaffhausen',
1176 '17' => 'Schwyz',
1177 '18' => 'Solothurn',
1178 '19' => 'Thurgau',
1179 '20' => 'Ticino',
1180 '21' => 'Uri',
1181 '22' => 'Valais',
1182 '23' => 'Vaud',
1183 '24' => 'Zug',
1184 '25' => 'Zurich',
1185 '26' => 'Jura'
1186 },
1187 'CI' => {
1188 '74' => 'Agneby',
1189 '75' => 'Bafing',
1190 '76' => 'Bas-Sassandra',
1191 '77' => 'Denguele',
1192 '78' => 'Dix-Huit Montagnes',
1193 '79' => 'Fromager',
1194 '80' => 'Haut-Sassandra',
1195 '81' => 'Lacs',
1196 '82' => 'Lagunes',
1197 '83' => 'Marahoue',
1198 '84' => 'Moyen-Cavally',
1199 '85' => 'Moyen-Comoe',
1200 '86' => 'N\'zi-Comoe',
1201 '87' => 'Savanes',
1202 '88' => 'Sud-Bandama',
1203 '89' => 'Sud-Comoe',
1204 '90' => 'Vallee du Bandama',
1205 '91' => 'Worodougou',
1206 '92' => 'Zanzan'
1207 },
1208 'CL' => {
1209 '01' => 'Valparaiso',
1210 '02' => 'Aisen del General Carlos Ibanez del Campo',
1211 '03' => 'Antofagasta',
1212 '04' => 'Araucania',
1213 '05' => 'Atacama',
1214 '06' => 'Bio-Bio',
1215 '07' => 'Coquimbo',
1216 '08' => 'Libertador General Bernardo O\'Higgins',
1217 '09' => 'Los Lagos',
1218 '10' => 'Magallanes y de la Antartica Chilena',
1219 '11' => 'Maule',
1220 '12' => 'Region Metropolitana',
1221 '13' => 'Tarapaca',
1222 '14' => 'Los Lagos',
1223 '15' => 'Tarapaca',
1224 '16' => 'Arica y Parinacota',
1225 '17' => 'Los Rios'
1226 },
1227 'CM' => {
1228 '04' => 'Est',
1229 '05' => 'Littoral',
1230 '07' => 'Nord-Ouest',
1231 '08' => 'Ouest',
1232 '09' => 'Sud-Ouest',
1233 '10' => 'Adamaoua',
1234 '11' => 'Centre',
1235 '12' => 'Extreme-Nord',
1236 '13' => 'Nord',
1237 '14' => 'Sud'
1238 },
1239 'CN' => {
1240 '01' => 'Anhui',
1241 '02' => 'Zhejiang',
1242 '03' => 'Jiangxi',
1243 '04' => 'Jiangsu',
1244 '05' => 'Jilin',
1245 '06' => 'Qinghai',
1246 '07' => 'Fujian',
1247 '08' => 'Heilongjiang',
1248 '09' => 'Henan',
1249 '10' => 'Hebei',
1250 '11' => 'Hunan',
1251 '12' => 'Hubei',
1252 '13' => 'Xinjiang',
1253 '14' => 'Xizang',
1254 '15' => 'Gansu',
1255 '16' => 'Guangxi',
1256 '18' => 'Guizhou',
1257 '19' => 'Liaoning',
1258 '20' => 'Nei Mongol',
1259 '21' => 'Ningxia',
1260 '22' => 'Beijing',
1261 '23' => 'Shanghai',
1262 '24' => 'Shanxi',
1263 '25' => 'Shandong',
1264 '26' => 'Shaanxi',
1265 '28' => 'Tianjin',
1266 '29' => 'Yunnan',
1267 '30' => 'Guangdong',
1268 '31' => 'Hainan',
1269 '32' => 'Sichuan',
1270 '33' => 'Chongqing'
1271 },
1272 'CO' => {
1273 '01' => 'Amazonas',
1274 '02' => 'Antioquia',
1275 '03' => 'Arauca',
1276 '04' => 'Atlantico',
1277 '08' => 'Caqueta',
1278 '09' => 'Cauca',
1279 '10' => 'Cesar',
1280 '11' => 'Choco',
1281 '12' => 'Cordoba',
1282 '14' => 'Guaviare',
1283 '15' => 'Guainia',
1284 '16' => 'Huila',
1285 '17' => 'La Guajira',
1286 '19' => 'Meta',
1287 '20' => 'Narino',
1288 '21' => 'Norte de Santander',
1289 '22' => 'Putumayo',
1290 '23' => 'Quindio',
1291 '24' => 'Risaralda',
1292 '25' => 'San Andres y Providencia',
1293 '26' => 'Santander',
1294 '27' => 'Sucre',
1295 '28' => 'Tolima',
1296 '29' => 'Valle del Cauca',
1297 '30' => 'Vaupes',
1298 '31' => 'Vichada',
1299 '32' => 'Casanare',
1300 '33' => 'Cundinamarca',
1301 '34' => 'Distrito Especial',
1302 '35' => 'Bolivar',
1303 '36' => 'Boyaca',
1304 '37' => 'Caldas',
1305 '38' => 'Magdalena'
1306 },
1307 'CR' => {
1308 '01' => 'Alajuela',
1309 '02' => 'Cartago',
1310 '03' => 'Guanacaste',
1311 '04' => 'Heredia',
1312 '06' => 'Limon',
1313 '07' => 'Puntarenas',
1314 '08' => 'San Jose'
1315 },
1316 'CU' => {
1317 '01' => 'Pinar del Rio',
1318 '02' => 'Ciudad de la Habana',
1319 '03' => 'Matanzas',
1320 '04' => 'Isla de la Juventud',
1321 '05' => 'Camaguey',
1322 '07' => 'Ciego de Avila',
1323 '08' => 'Cienfuegos',
1324 '09' => 'Granma',
1325 '10' => 'Guantanamo',
1326 '11' => 'La Habana',
1327 '12' => 'Holguin',
1328 '13' => 'Las Tunas',
1329 '14' => 'Sancti Spiritus',
1330 '15' => 'Santiago de Cuba',
1331 '16' => 'Villa Clara'
1332 },
1333 'CV' => {
1334 '01' => 'Boa Vista',
1335 '02' => 'Brava',
1336 '04' => 'Maio',
1337 '05' => 'Paul',
1338 '07' => 'Ribeira Grande',
1339 '08' => 'Sal',
1340 '10' => 'Sao Nicolau',
1341 '11' => 'Sao Vicente',
1342 '13' => 'Mosteiros',
1343 '14' => 'Praia',
1344 '15' => 'Santa Catarina',
1345 '16' => 'Santa Cruz',
1346 '17' => 'Sao Domingos',
1347 '18' => 'Sao Filipe',
1348 '19' => 'Sao Miguel',
1349 '20' => 'Tarrafal'
1350 },
1351 'CY' => {
1352 '01' => 'Famagusta',
1353 '02' => 'Kyrenia',
1354 '03' => 'Larnaca',
1355 '04' => 'Nicosia',
1356 '05' => 'Limassol',
1357 '06' => 'Paphos'
1358 },
1359 'CZ' => {
1360 '52' => 'Hlavni mesto Praha',
1361 '78' => 'Jihomoravsky kraj',
1362 '79' => 'Jihocesky kraj',
1363 '80' => 'Vysocina',
1364 '81' => 'Karlovarsky kraj',
1365 '82' => 'Kralovehradecky kraj',
1366 '83' => 'Liberecky kraj',
1367 '84' => 'Olomoucky kraj',
1368 '85' => 'Moravskoslezsky kraj',
1369 '86' => 'Pardubicky kraj',
1370 '87' => 'Plzensky kraj',
1371 '88' => 'Stredocesky kraj',
1372 '89' => 'Ustecky kraj',
1373 '90' => 'Zlinsky kraj'
1374 },
1375 'DE' => {
1376 '01' => 'Baden-Wurttemberg',
1377 '02' => 'Bayern',
1378 '03' => 'Bremen',
1379 '04' => 'Hamburg',
1380 '05' => 'Hessen',
1381 '06' => 'Niedersachsen',
1382 '07' => 'Nordrhein-Westfalen',
1383 '08' => 'Rheinland-Pfalz',
1384 '09' => 'Saarland',
1385 '10' => 'Schleswig-Holstein',
1386 '11' => 'Brandenburg',
1387 '12' => 'Mecklenburg-Vorpommern',
1388 '13' => 'Sachsen',
1389 '14' => 'Sachsen-Anhalt',
1390 '15' => 'Thuringen',
1391 '16' => 'Berlin'
1392 },
1393 'DJ' => {
1394 '01' => 'Ali Sabieh',
1395 '04' => 'Obock',
1396 '05' => 'Tadjoura',
1397 '06' => 'Dikhil',
1398 '07' => 'Djibouti',
1399 '08' => 'Arta'
1400 },
1401 'DK' => {
1402 '17' => 'Hovedstaden',
1403 '18' => 'Midtjylland',
1404 '19' => 'Nordjylland',
1405 '20' => 'Sjelland',
1406 '21' => 'Syddanmark'
1407 },
1408 'DM' => {
1409 '02' => 'Saint Andrew',
1410 '03' => 'Saint David',
1411 '04' => 'Saint George',
1412 '05' => 'Saint John',
1413 '06' => 'Saint Joseph',
1414 '07' => 'Saint Luke',
1415 '08' => 'Saint Mark',
1416 '09' => 'Saint Patrick',
1417 '10' => 'Saint Paul',
1418 '11' => 'Saint Peter'
1419 },
1420 'DO' => {
1421 '01' => 'Azua',
1422 '02' => 'Baoruco',
1423 '03' => 'Barahona',
1424 '04' => 'Dajabon',
1425 '05' => 'Distrito Nacional',
1426 '06' => 'Duarte',
1427 '08' => 'Espaillat',
1428 '09' => 'Independencia',
1429 '10' => 'La Altagracia',
1430 '11' => 'Elias Pina',
1431 '12' => 'La Romana',
1432 '14' => 'Maria Trinidad Sanchez',
1433 '15' => 'Monte Cristi',
1434 '16' => 'Pedernales',
1435 '17' => 'Peravia',
1436 '18' => 'Puerto Plata',
1437 '19' => 'Salcedo',
1438 '20' => 'Samana',
1439 '21' => 'Sanchez Ramirez',
1440 '23' => 'San Juan',
1441 '24' => 'San Pedro De Macoris',
1442 '25' => 'Santiago',
1443 '26' => 'Santiago Rodriguez',
1444 '27' => 'Valverde',
1445 '28' => 'El Seibo',
1446 '29' => 'Hato Mayor',
1447 '30' => 'La Vega',
1448 '31' => 'Monsenor Nouel',
1449 '32' => 'Monte Plata',
1450 '33' => 'San Cristobal',
1451 '34' => 'Distrito Nacional',
1452 '35' => 'Peravia',
1453 '36' => 'San Jose de Ocoa',
1454 '37' => 'Santo Domingo'
1455 },
1456 'DZ' => {
1457 '01' => 'Alger',
1458 '03' => 'Batna',
1459 '04' => 'Constantine',
1460 '06' => 'Medea',
1461 '07' => 'Mostaganem',
1462 '09' => 'Oran',
1463 '10' => 'Saida',
1464 '12' => 'Setif',
1465 '13' => 'Tiaret',
1466 '14' => 'Tizi Ouzou',
1467 '15' => 'Tlemcen',
1468 '18' => 'Bejaia',
1469 '19' => 'Biskra',
1470 '20' => 'Blida',
1471 '21' => 'Bouira',
1472 '22' => 'Djelfa',
1473 '23' => 'Guelma',
1474 '24' => 'Jijel',
1475 '25' => 'Laghouat',
1476 '26' => 'Mascara',
1477 '27' => 'M\'sila',
1478 '29' => 'Oum el Bouaghi',
1479 '30' => 'Sidi Bel Abbes',
1480 '31' => 'Skikda',
1481 '33' => 'Tebessa',
1482 '34' => 'Adrar',
1483 '35' => 'Ain Defla',
1484 '36' => 'Ain Temouchent',
1485 '37' => 'Annaba',
1486 '38' => 'Bechar',
1487 '39' => 'Bordj Bou Arreridj',
1488 '40' => 'Boumerdes',
1489 '41' => 'Chlef',
1490 '42' => 'El Bayadh',
1491 '43' => 'El Oued',
1492 '44' => 'El Tarf',
1493 '45' => 'Ghardaia',
1494 '46' => 'Illizi',
1495 '47' => 'Khenchela',
1496 '48' => 'Mila',
1497 '49' => 'Naama',
1498 '50' => 'Ouargla',
1499 '51' => 'Relizane',
1500 '52' => 'Souk Ahras',
1501 '53' => 'Tamanghasset',
1502 '54' => 'Tindouf',
1503 '55' => 'Tipaza',
1504 '56' => 'Tissemsilt'
1505 },
1506 'EC' => {
1507 '01' => 'Galapagos',
1508 '02' => 'Azuay',
1509 '03' => 'Bolivar',
1510 '04' => 'Canar',
1511 '05' => 'Carchi',
1512 '06' => 'Chimborazo',
1513 '07' => 'Cotopaxi',
1514 '08' => 'El Oro',
1515 '09' => 'Esmeraldas',
1516 '10' => 'Guayas',
1517 '11' => 'Imbabura',
1518 '12' => 'Loja',
1519 '13' => 'Los Rios',
1520 '14' => 'Manabi',
1521 '15' => 'Morona-Santiago',
1522 '17' => 'Pastaza',
1523 '18' => 'Pichincha',
1524 '19' => 'Tungurahua',
1525 '20' => 'Zamora-Chinchipe',
1526 '22' => 'Sucumbios',
1527 '23' => 'Napo',
1528 '24' => 'Orellana'
1529 },
1530 'EE' => {
1531 '01' => 'Harjumaa',
1532 '02' => 'Hiiumaa',
1533 '03' => 'Ida-Virumaa',
1534 '04' => 'Jarvamaa',
1535 '05' => 'Jogevamaa',
1536 '06' => 'Kohtla-Jarve',
1537 '07' => 'Laanemaa',
1538 '08' => 'Laane-Virumaa',
1539 '09' => 'Narva',
1540 '10' => 'Parnu',
1541 '11' => 'Parnumaa',
1542 '12' => 'Polvamaa',
1543 '13' => 'Raplamaa',
1544 '14' => 'Saaremaa',
1545 '15' => 'Sillamae',
1546 '16' => 'Tallinn',
1547 '17' => 'Tartu',
1548 '18' => 'Tartumaa',
1549 '19' => 'Valgamaa',
1550 '20' => 'Viljandimaa',
1551 '21' => 'Vorumaa'
1552 },
1553 'EG' => {
1554 '01' => 'Ad Daqahliyah',
1555 '02' => 'Al Bahr al Ahmar',
1556 '03' => 'Al Buhayrah',
1557 '04' => 'Al Fayyum',
1558 '05' => 'Al Gharbiyah',
1559 '06' => 'Al Iskandariyah',
1560 '07' => 'Al Isma\'iliyah',
1561 '08' => 'Al Jizah',
1562 '09' => 'Al Minufiyah',
1563 '10' => 'Al Minya',
1564 '11' => 'Al Qahirah',
1565 '12' => 'Al Qalyubiyah',
1566 '13' => 'Al Wadi al Jadid',
1567 '14' => 'Ash Sharqiyah',
1568 '15' => 'As Suways',
1569 '16' => 'Aswan',
1570 '17' => 'Asyut',
1571 '18' => 'Bani Suwayf',
1572 '19' => 'Bur Sa\'id',
1573 '20' => 'Dumyat',
1574 '21' => 'Kafr ash Shaykh',
1575 '22' => 'Matruh',
1576 '23' => 'Qina',
1577 '24' => 'Suhaj',
1578 '26' => 'Janub Sina\'',
1579 '27' => 'Shamal Sina\'',
1580 '28' => 'Al Uqsur'
1581 },
1582 'ER' => {
1583 '01' => 'Anseba',
1584 '02' => 'Debub',
1585 '03' => 'Debubawi K\'eyih Bahri',
1586 '04' => 'Gash Barka',
1587 '05' => 'Ma\'akel',
1588 '06' => 'Semenawi K\'eyih Bahri'
1589 },
1590 'ES' => {
1591 '07' => 'Islas Baleares',
1592 '27' => 'La Rioja',
1593 '29' => 'Madrid',
1594 '31' => 'Murcia',
1595 '32' => 'Navarra',
1596 '34' => 'Asturias',
1597 '39' => 'Cantabria',
1598 '51' => 'Andalucia',
1599 '52' => 'Aragon',
1600 '53' => 'Canarias',
1601 '54' => 'Castilla-La Mancha',
1602 '55' => 'Castilla y Leon',
1603 '56' => 'Catalonia',
1604 '57' => 'Extremadura',
1605 '58' => 'Galicia',
1606 '59' => 'Pais Vasco',
1607 '60' => 'Comunidad Valenciana'
1608 },
1609 'ET' => {
1610 '44' => 'Adis Abeba',
1611 '45' => 'Afar',
1612 '46' => 'Amara',
1613 '47' => 'Binshangul Gumuz',
1614 '48' => 'Dire Dawa',
1615 '49' => 'Gambela Hizboch',
1616 '50' => 'Hareri Hizb',
1617 '51' => 'Oromiya',
1618 '52' => 'Sumale',
1619 '53' => 'Tigray',
1620 '54' => 'YeDebub Biheroch Bihereseboch na Hizboch'
1621 },
1622 'FI' => {
1623 '01' => 'Aland',
1624 '06' => 'Lapland',
1625 '08' => 'Oulu',
1626 '13' => 'Southern Finland',
1627 '14' => 'Eastern Finland',
1628 '15' => 'Western Finland'
1629 },
1630 'FJ' => {
1631 '01' => 'Central',
1632 '02' => 'Eastern',
1633 '03' => 'Northern',
1634 '04' => 'Rotuma',
1635 '05' => 'Western'
1636 },
1637 'FM' => {
1638 '01' => 'Kosrae',
1639 '02' => 'Pohnpei',
1640 '03' => 'Chuuk',
1641 '04' => 'Yap'
1642 },
1643 'FR' => {
1644 '97' => 'Aquitaine',
1645 '98' => 'Auvergne',
1646 '99' => 'Basse-Normandie',
1647 'A1' => 'Bourgogne',
1648 'A2' => 'Bretagne',
1649 'A3' => 'Centre',
1650 'A4' => 'Champagne-Ardenne',
1651 'A5' => 'Corse',
1652 'A6' => 'Franche-Comte',
1653 'A7' => 'Haute-Normandie',
1654 'A8' => 'Ile-de-France',
1655 'A9' => 'Languedoc-Roussillon',
1656 'B1' => 'Limousin',
1657 'B2' => 'Lorraine',
1658 'B3' => 'Midi-Pyrenees',
1659 'B4' => 'Nord-Pas-de-Calais',
1660 'B5' => 'Pays de la Loire',
1661 'B6' => 'Picardie',
1662 'B7' => 'Poitou-Charentes',
1663 'B8' => 'Provence-Alpes-Cote d\'Azur',
1664 'B9' => 'Rhone-Alpes',
1665 'C1' => 'Alsace'
1666 },
1667 'GA' => {
1668 '01' => 'Estuaire',
1669 '02' => 'Haut-Ogooue',
1670 '03' => 'Moyen-Ogooue',
1671 '04' => 'Ngounie',
1672 '05' => 'Nyanga',
1673 '06' => 'Ogooue-Ivindo',
1674 '07' => 'Ogooue-Lolo',
1675 '08' => 'Ogooue-Maritime',
1676 '09' => 'Woleu-Ntem'
1677 },
1678 'GB' => {
1679 'A1' => 'Barking and Dagenham',
1680 'A2' => 'Barnet',
1681 'A3' => 'Barnsley',
1682 'A4' => 'Bath and North East Somerset',
1683 'A5' => 'Bedfordshire',
1684 'A6' => 'Bexley',
1685 'A7' => 'Birmingham',
1686 'A8' => 'Blackburn with Darwen',
1687 'A9' => 'Blackpool',
1688 'B1' => 'Bolton',
1689 'B2' => 'Bournemouth',
1690 'B3' => 'Bracknell Forest',
1691 'B4' => 'Bradford',
1692 'B5' => 'Brent',
1693 'B6' => 'Brighton and Hove',
1694 'B7' => 'Bristol, City of',
1695 'B8' => 'Bromley',
1696 'B9' => 'Buckinghamshire',
1697 'C1' => 'Bury',
1698 'C2' => 'Calderdale',
1699 'C3' => 'Cambridgeshire',
1700 'C4' => 'Camden',
1701 'C5' => 'Cheshire',
1702 'C6' => 'Cornwall',
1703 'C7' => 'Coventry',
1704 'C8' => 'Croydon',
1705 'C9' => 'Cumbria',
1706 'D1' => 'Darlington',
1707 'D2' => 'Derby',
1708 'D3' => 'Derbyshire',
1709 'D4' => 'Devon',
1710 'D5' => 'Doncaster',
1711 'D6' => 'Dorset',
1712 'D7' => 'Dudley',
1713 'D8' => 'Durham',
1714 'D9' => 'Ealing',
1715 'E1' => 'East Riding of Yorkshire',
1716 'E2' => 'East Sussex',
1717 'E3' => 'Enfield',
1718 'E4' => 'Essex',
1719 'E5' => 'Gateshead',
1720 'E6' => 'Gloucestershire',
1721 'E7' => 'Greenwich',
1722 'E8' => 'Hackney',
1723 'E9' => 'Halton',
1724 'F1' => 'Hammersmith and Fulham',
1725 'F2' => 'Hampshire',
1726 'F3' => 'Haringey',
1727 'F4' => 'Harrow',
1728 'F5' => 'Hartlepool',
1729 'F6' => 'Havering',
1730 'F7' => 'Herefordshire',
1731 'F8' => 'Hertford',
1732 'F9' => 'Hillingdon',
1733 'G1' => 'Hounslow',
1734 'G2' => 'Isle of Wight',
1735 'G3' => 'Islington',
1736 'G4' => 'Kensington and Chelsea',
1737 'G5' => 'Kent',
1738 'G6' => 'Kingston upon Hull, City of',
1739 'G7' => 'Kingston upon Thames',
1740 'G8' => 'Kirklees',
1741 'G9' => 'Knowsley',
1742 'H1' => 'Lambeth',
1743 'H2' => 'Lancashire',
1744 'H3' => 'Leeds',
1745 'H4' => 'Leicester',
1746 'H5' => 'Leicestershire',
1747 'H6' => 'Lewisham',
1748 'H7' => 'Lincolnshire',
1749 'H8' => 'Liverpool',
1750 'H9' => 'London, City of',
1751 'I1' => 'Luton',
1752 'I2' => 'Manchester',
1753 'I3' => 'Medway',
1754 'I4' => 'Merton',
1755 'I5' => 'Middlesbrough',
1756 'I6' => 'Milton Keynes',
1757 'I7' => 'Newcastle upon Tyne',
1758 'I8' => 'Newham',
1759 'I9' => 'Norfolk',
1760 'J1' => 'Northamptonshire',
1761 'J2' => 'North East Lincolnshire',
1762 'J3' => 'North Lincolnshire',
1763 'J4' => 'North Somerset',
1764 'J5' => 'North Tyneside',
1765 'J6' => 'Northumberland',
1766 'J7' => 'North Yorkshire',
1767 'J8' => 'Nottingham',
1768 'J9' => 'Nottinghamshire',
1769 'K1' => 'Oldham',
1770 'K2' => 'Oxfordshire',
1771 'K3' => 'Peterborough',
1772 'K4' => 'Plymouth',
1773 'K5' => 'Poole',
1774 'K6' => 'Portsmouth',
1775 'K7' => 'Reading',
1776 'K8' => 'Redbridge',
1777 'K9' => 'Redcar and Cleveland',
1778 'L1' => 'Richmond upon Thames',
1779 'L2' => 'Rochdale',
1780 'L3' => 'Rotherham',
1781 'L4' => 'Rutland',
1782 'L5' => 'Salford',
1783 'L6' => 'Shropshire',
1784 'L7' => 'Sandwell',
1785 'L8' => 'Sefton',
1786 'L9' => 'Sheffield',
1787 'M1' => 'Slough',
1788 'M2' => 'Solihull',
1789 'M3' => 'Somerset',
1790 'M4' => 'Southampton',
1791 'M5' => 'Southend-on-Sea',
1792 'M6' => 'South Gloucestershire',
1793 'M7' => 'South Tyneside',
1794 'M8' => 'Southwark',
1795 'M9' => 'Staffordshire',
1796 'N1' => 'St. Helens',
1797 'N2' => 'Stockport',
1798 'N3' => 'Stockton-on-Tees',
1799 'N4' => 'Stoke-on-Trent',
1800 'N5' => 'Suffolk',
1801 'N6' => 'Sunderland',
1802 'N7' => 'Surrey',
1803 'N8' => 'Sutton',
1804 'N9' => 'Swindon',
1805 'O1' => 'Tameside',
1806 'O2' => 'Telford and Wrekin',
1807 'O3' => 'Thurrock',
1808 'O4' => 'Torbay',
1809 'O5' => 'Tower Hamlets',
1810 'O6' => 'Trafford',
1811 'O7' => 'Wakefield',
1812 'O8' => 'Walsall',
1813 'O9' => 'Waltham Forest',
1814 'P1' => 'Wandsworth',
1815 'P2' => 'Warrington',
1816 'P3' => 'Warwickshire',
1817 'P4' => 'West Berkshire',
1818 'P5' => 'Westminster',
1819 'P6' => 'West Sussex',
1820 'P7' => 'Wigan',
1821 'P8' => 'Wiltshire',
1822 'P9' => 'Windsor and Maidenhead',
1823 'Q1' => 'Wirral',
1824 'Q2' => 'Wokingham',
1825 'Q3' => 'Wolverhampton',
1826 'Q4' => 'Worcestershire',
1827 'Q5' => 'York',
1828 'Q6' => 'Antrim',
1829 'Q7' => 'Ards',
1830 'Q8' => 'Armagh',
1831 'Q9' => 'Ballymena',
1832 'R1' => 'Ballymoney',
1833 'R2' => 'Banbridge',
1834 'R3' => 'Belfast',
1835 'R4' => 'Carrickfergus',
1836 'R5' => 'Castlereagh',
1837 'R6' => 'Coleraine',
1838 'R7' => 'Cookstown',
1839 'R8' => 'Craigavon',
1840 'R9' => 'Down',
1841 'S1' => 'Dungannon',
1842 'S2' => 'Fermanagh',
1843 'S3' => 'Larne',
1844 'S4' => 'Limavady',
1845 'S5' => 'Lisburn',
1846 'S6' => 'Derry',
1847 'S7' => 'Magherafelt',
1848 'S8' => 'Moyle',
1849 'S9' => 'Newry and Mourne',
1850 'T1' => 'Newtownabbey',
1851 'T2' => 'North Down',
1852 'T3' => 'Omagh',
1853 'T4' => 'Strabane',
1854 'T5' => 'Aberdeen City',
1855 'T6' => 'Aberdeenshire',
1856 'T7' => 'Angus',
1857 'T8' => 'Argyll and Bute',
1858 'T9' => 'Scottish Borders, The',
1859 'U1' => 'Clackmannanshire',
1860 'U2' => 'Dumfries and Galloway',
1861 'U3' => 'Dundee City',
1862 'U4' => 'East Ayrshire',
1863 'U5' => 'East Dunbartonshire',
1864 'U6' => 'East Lothian',
1865 'U7' => 'East Renfrewshire',
1866 'U8' => 'Edinburgh, City of',
1867 'U9' => 'Falkirk',
1868 'V1' => 'Fife',
1869 'V2' => 'Glasgow City',
1870 'V3' => 'Highland',
1871 'V4' => 'Inverclyde',
1872 'V5' => 'Midlothian',
1873 'V6' => 'Moray',
1874 'V7' => 'North Ayrshire',
1875 'V8' => 'North Lanarkshire',
1876 'V9' => 'Orkney',
1877 'W1' => 'Perth and Kinross',
1878 'W2' => 'Renfrewshire',
1879 'W3' => 'Shetland Islands',
1880 'W4' => 'South Ayrshire',
1881 'W5' => 'South Lanarkshire',
1882 'W6' => 'Stirling',
1883 'W7' => 'West Dunbartonshire',
1884 'W8' => 'Eilean Siar',
1885 'W9' => 'West Lothian',
1886 'X1' => 'Isle of Anglesey',
1887 'X2' => 'Blaenau Gwent',
1888 'X3' => 'Bridgend',
1889 'X4' => 'Caerphilly',
1890 'X5' => 'Cardiff',
1891 'X6' => 'Ceredigion',
1892 'X7' => 'Carmarthenshire',
1893 'X8' => 'Conwy',
1894 'X9' => 'Denbighshire',
1895 'Y1' => 'Flintshire',
1896 'Y2' => 'Gwynedd',
1897 'Y3' => 'Merthyr Tydfil',
1898 'Y4' => 'Monmouthshire',
1899 'Y5' => 'Neath Port Talbot',
1900 'Y6' => 'Newport',
1901 'Y7' => 'Pembrokeshire',
1902 'Y8' => 'Powys',
1903 'Y9' => 'Rhondda Cynon Taff',
1904 'Z1' => 'Swansea',
1905 'Z2' => 'Torfaen',
1906 'Z3' => 'Vale of Glamorgan, The',
1907 'Z4' => 'Wrexham',
1908 'Z5' => 'Bedfordshire',
1909 'Z6' => 'Central Bedfordshire',
1910 'Z7' => 'Cheshire East',
1911 'Z8' => 'Cheshire West and Chester',
1912 'Z9' => 'Isles of Scilly'
1913 },
1914 'GD' => {
1915 '01' => 'Saint Andrew',
1916 '02' => 'Saint David',
1917 '03' => 'Saint George',
1918 '04' => 'Saint John',
1919 '05' => 'Saint Mark',
1920 '06' => 'Saint Patrick'
1921 },
1922 'GE' => {
1923 '01' => 'Abashis Raioni',
1924 '02' => 'Abkhazia',
1925 '03' => 'Adigenis Raioni',
1926 '04' => 'Ajaria',
1927 '05' => 'Akhalgoris Raioni',
1928 '06' => 'Akhalk\'alak\'is Raioni',
1929 '07' => 'Akhalts\'ikhis Raioni',
1930 '08' => 'Akhmetis Raioni',
1931 '09' => 'Ambrolauris Raioni',
1932 '10' => 'Aspindzis Raioni',
1933 '11' => 'Baghdat\'is Raioni',
1934 '12' => 'Bolnisis Raioni',
1935 '13' => 'Borjomis Raioni',
1936 '14' => 'Chiat\'ura',
1937 '15' => 'Ch\'khorotsqus Raioni',
1938 '16' => 'Ch\'okhatauris Raioni',
1939 '17' => 'Dedop\'listsqaros Raioni',
1940 '18' => 'Dmanisis Raioni',
1941 '19' => 'Dushet\'is Raioni',
1942 '20' => 'Gardabanis Raioni',
1943 '21' => 'Gori',
1944 '22' => 'Goris Raioni',
1945 '23' => 'Gurjaanis Raioni',
1946 '24' => 'Javis Raioni',
1947 '25' => 'K\'arelis Raioni',
1948 '26' => 'Kaspis Raioni',
1949 '27' => 'Kharagaulis Raioni',
1950 '28' => 'Khashuris Raioni',
1951 '29' => 'Khobis Raioni',
1952 '30' => 'Khonis Raioni',
1953 '31' => 'K\'ut\'aisi',
1954 '32' => 'Lagodekhis Raioni',
1955 '33' => 'Lanch\'khut\'is Raioni',
1956 '34' => 'Lentekhis Raioni',
1957 '35' => 'Marneulis Raioni',
1958 '36' => 'Martvilis Raioni',
1959 '37' => 'Mestiis Raioni',
1960 '38' => 'Mts\'khet\'is Raioni',
1961 '39' => 'Ninotsmindis Raioni',
1962 '40' => 'Onis Raioni',
1963 '41' => 'Ozurget\'is Raioni',
1964 '42' => 'P\'ot\'i',
1965 '43' => 'Qazbegis Raioni',
1966 '44' => 'Qvarlis Raioni',
1967 '45' => 'Rust\'avi',
1968 '46' => 'Sach\'kheris Raioni',
1969 '47' => 'Sagarejos Raioni',
1970 '48' => 'Samtrediis Raioni',
1971 '49' => 'Senakis Raioni',
1972 '50' => 'Sighnaghis Raioni',
1973 '51' => 'T\'bilisi',
1974 '52' => 'T\'elavis Raioni',
1975 '53' => 'T\'erjolis Raioni',
1976 '54' => 'T\'et\'ritsqaros Raioni',
1977 '55' => 'T\'ianet\'is Raioni',
1978 '56' => 'Tqibuli',
1979 '57' => 'Ts\'ageris Raioni',
1980 '58' => 'Tsalenjikhis Raioni',
1981 '59' => 'Tsalkis Raioni',
1982 '60' => 'Tsqaltubo',
1983 '61' => 'Vanis Raioni',
1984 '62' => 'Zestap\'onis Raioni',
1985 '63' => 'Zugdidi',
1986 '64' => 'Zugdidis Raioni'
1987 },
1988 'GH' => {
1989 '01' => 'Greater Accra',
1990 '02' => 'Ashanti',
1991 '03' => 'Brong-Ahafo',
1992 '04' => 'Central',
1993 '05' => 'Eastern',
1994 '06' => 'Northern',
1995 '08' => 'Volta',
1996 '09' => 'Western',
1997 '10' => 'Upper East',
1998 '11' => 'Upper West'
1999 },
2000 'GL' => {
2001 '01' => 'Nordgronland',
2002 '02' => 'Ostgronland',
2003 '03' => 'Vestgronland'
2004 },
2005 'GM' => {
2006 '01' => 'Banjul',
2007 '02' => 'Lower River',
2008 '03' => 'Central River',
2009 '04' => 'Upper River',
2010 '05' => 'Western',
2011 '07' => 'North Bank'
2012 },
2013 'GN' => {
2014 '01' => 'Beyla',
2015 '02' => 'Boffa',
2016 '03' => 'Boke',
2017 '04' => 'Conakry',
2018 '05' => 'Dabola',
2019 '06' => 'Dalaba',
2020 '07' => 'Dinguiraye',
2021 '09' => 'Faranah',
2022 '10' => 'Forecariah',
2023 '11' => 'Fria',
2024 '12' => 'Gaoual',
2025 '13' => 'Gueckedou',
2026 '15' => 'Kerouane',
2027 '16' => 'Kindia',
2028 '17' => 'Kissidougou',
2029 '18' => 'Koundara',
2030 '19' => 'Kouroussa',
2031 '21' => 'Macenta',
2032 '22' => 'Mali',
2033 '23' => 'Mamou',
2034 '25' => 'Pita',
2035 '27' => 'Telimele',
2036 '28' => 'Tougue',
2037 '29' => 'Yomou',
2038 '30' => 'Coyah',
2039 '31' => 'Dubreka',
2040 '32' => 'Kankan',
2041 '33' => 'Koubia',
2042 '34' => 'Labe',
2043 '35' => 'Lelouma',
2044 '36' => 'Lola',
2045 '37' => 'Mandiana',
2046 '38' => 'Nzerekore',
2047 '39' => 'Siguiri'
2048 },
2049 'GQ' => {
2050 '03' => 'Annobon',
2051 '04' => 'Bioko Norte',
2052 '05' => 'Bioko Sur',
2053 '06' => 'Centro Sur',
2054 '07' => 'Kie-Ntem',
2055 '08' => 'Litoral',
2056 '09' => 'Wele-Nzas'
2057 },
2058 'GR' => {
2059 '01' => 'Evros',
2060 '02' => 'Rodhopi',
2061 '03' => 'Xanthi',
2062 '04' => 'Drama',
2063 '05' => 'Serrai',
2064 '06' => 'Kilkis',
2065 '07' => 'Pella',
2066 '08' => 'Florina',
2067 '09' => 'Kastoria',
2068 '10' => 'Grevena',
2069 '11' => 'Kozani',
2070 '12' => 'Imathia',
2071 '13' => 'Thessaloniki',
2072 '14' => 'Kavala',
2073 '15' => 'Khalkidhiki',
2074 '16' => 'Pieria',
2075 '17' => 'Ioannina',
2076 '18' => 'Thesprotia',
2077 '19' => 'Preveza',
2078 '20' => 'Arta',
2079 '21' => 'Larisa',
2080 '22' => 'Trikala',
2081 '23' => 'Kardhitsa',
2082 '24' => 'Magnisia',
2083 '25' => 'Kerkira',
2084 '26' => 'Levkas',
2085 '27' => 'Kefallinia',
2086 '28' => 'Zakinthos',
2087 '29' => 'Fthiotis',
2088 '30' => 'Evritania',
2089 '31' => 'Aitolia kai Akarnania',
2090 '32' => 'Fokis',
2091 '33' => 'Voiotia',
2092 '34' => 'Evvoia',
2093 '35' => 'Attiki',
2094 '36' => 'Argolis',
2095 '37' => 'Korinthia',
2096 '38' => 'Akhaia',
2097 '39' => 'Ilia',
2098 '40' => 'Messinia',
2099 '41' => 'Arkadhia',
2100 '42' => 'Lakonia',
2101 '43' => 'Khania',
2102 '44' => 'Rethimni',
2103 '45' => 'Iraklion',
2104 '46' => 'Lasithi',
2105 '47' => 'Dhodhekanisos',
2106 '48' => 'Samos',
2107 '49' => 'Kikladhes',
2108 '50' => 'Khios',
2109 '51' => 'Lesvos'
2110 },
2111 'GT' => {
2112 '01' => 'Alta Verapaz',
2113 '02' => 'Baja Verapaz',
2114 '03' => 'Chimaltenango',
2115 '04' => 'Chiquimula',
2116 '05' => 'El Progreso',
2117 '06' => 'Escuintla',
2118 '07' => 'Guatemala',
2119 '08' => 'Huehuetenango',
2120 '09' => 'Izabal',
2121 '10' => 'Jalapa',
2122 '11' => 'Jutiapa',
2123 '12' => 'Peten',
2124 '13' => 'Quetzaltenango',
2125 '14' => 'Quiche',
2126 '15' => 'Retalhuleu',
2127 '16' => 'Sacatepequez',
2128 '17' => 'San Marcos',
2129 '18' => 'Santa Rosa',
2130 '19' => 'Solola',
2131 '20' => 'Suchitepequez',
2132 '21' => 'Totonicapan',
2133 '22' => 'Zacapa'
2134 },
2135 'GW' => {
2136 '01' => 'Bafata',
2137 '02' => 'Quinara',
2138 '04' => 'Oio',
2139 '05' => 'Bolama',
2140 '06' => 'Cacheu',
2141 '07' => 'Tombali',
2142 '10' => 'Gabu',
2143 '11' => 'Bissau',
2144 '12' => 'Biombo'
2145 },
2146 'GY' => {
2147 '10' => 'Barima-Waini',
2148 '11' => 'Cuyuni-Mazaruni',
2149 '12' => 'Demerara-Mahaica',
2150 '13' => 'East Berbice-Corentyne',
2151 '14' => 'Essequibo Islands-West Demerara',
2152 '15' => 'Mahaica-Berbice',
2153 '16' => 'Pomeroon-Supenaam',
2154 '17' => 'Potaro-Siparuni',
2155 '18' => 'Upper Demerara-Berbice',
2156 '19' => 'Upper Takutu-Upper Essequibo'
2157 },
2158 'HN' => {
2159 '01' => 'Atlantida',
2160 '02' => 'Choluteca',
2161 '03' => 'Colon',
2162 '04' => 'Comayagua',
2163 '05' => 'Copan',
2164 '06' => 'Cortes',
2165 '07' => 'El Paraiso',
2166 '08' => 'Francisco Morazan',
2167 '09' => 'Gracias a Dios',
2168 '10' => 'Intibuca',
2169 '11' => 'Islas de la Bahia',
2170 '12' => 'La Paz',
2171 '13' => 'Lempira',
2172 '14' => 'Ocotepeque',
2173 '15' => 'Olancho',
2174 '16' => 'Santa Barbara',
2175 '17' => 'Valle',
2176 '18' => 'Yoro'
2177 },
2178 'HR' => {
2179 '01' => 'Bjelovarsko-Bilogorska',
2180 '02' => 'Brodsko-Posavska',
2181 '03' => 'Dubrovacko-Neretvanska',
2182 '04' => 'Istarska',
2183 '05' => 'Karlovacka',
2184 '06' => 'Koprivnicko-Krizevacka',
2185 '07' => 'Krapinsko-Zagorska',
2186 '08' => 'Licko-Senjska',
2187 '09' => 'Medimurska',
2188 '10' => 'Osjecko-Baranjska',
2189 '11' => 'Pozesko-Slavonska',
2190 '12' => 'Primorsko-Goranska',
2191 '13' => 'Sibensko-Kninska',
2192 '14' => 'Sisacko-Moslavacka',
2193 '15' => 'Splitsko-Dalmatinska',
2194 '16' => 'Varazdinska',
2195 '17' => 'Viroviticko-Podravska',
2196 '18' => 'Vukovarsko-Srijemska',
2197 '19' => 'Zadarska',
2198 '20' => 'Zagrebacka',
2199 '21' => 'Grad Zagreb'
2200 },
2201 'HT' => {
2202 '03' => 'Nord-Ouest',
2203 '06' => 'Artibonite',
2204 '07' => 'Centre',
2205 '09' => 'Nord',
2206 '10' => 'Nord-Est',
2207 '11' => 'Ouest',
2208 '12' => 'Sud',
2209 '13' => 'Sud-Est',
2210 '14' => 'Grand\' Anse',
2211 '15' => 'Nippes'
2212 },
2213 'HU' => {
2214 '01' => 'Bacs-Kiskun',
2215 '02' => 'Baranya',
2216 '03' => 'Bekes',
2217 '04' => 'Borsod-Abauj-Zemplen',
2218 '05' => 'Budapest',
2219 '06' => 'Csongrad',
2220 '07' => 'Debrecen',
2221 '08' => 'Fejer',
2222 '09' => 'Gyor-Moson-Sopron',
2223 '10' => 'Hajdu-Bihar',
2224 '11' => 'Heves',
2225 '12' => 'Komarom-Esztergom',
2226 '13' => 'Miskolc',
2227 '14' => 'Nograd',
2228 '15' => 'Pecs',
2229 '16' => 'Pest',
2230 '17' => 'Somogy',
2231 '18' => 'Szabolcs-Szatmar-Bereg',
2232 '19' => 'Szeged',
2233 '20' => 'Jasz-Nagykun-Szolnok',
2234 '21' => 'Tolna',
2235 '22' => 'Vas',
2236 '23' => 'Veszprem',
2237 '24' => 'Zala',
2238 '25' => 'Gyor',
2239 '26' => 'Bekescsaba',
2240 '27' => 'Dunaujvaros',
2241 '28' => 'Eger',
2242 '29' => 'Hodmezovasarhely',
2243 '30' => 'Kaposvar',
2244 '31' => 'Kecskemet',
2245 '32' => 'Nagykanizsa',
2246 '33' => 'Nyiregyhaza',
2247 '34' => 'Sopron',
2248 '35' => 'Szekesfehervar',
2249 '36' => 'Szolnok',
2250 '37' => 'Szombathely',
2251 '38' => 'Tatabanya',
2252 '39' => 'Veszprem',
2253 '40' => 'Zalaegerszeg',
2254 '41' => 'Salgotarjan',
2255 '42' => 'Szekszard',
2256 '43' => 'Erd'
2257 },
2258 'ID' => {
2259 '01' => 'Aceh',
2260 '02' => 'Bali',
2261 '03' => 'Bengkulu',
2262 '04' => 'Jakarta Raya',
2263 '05' => 'Jambi',
2264 '07' => 'Jawa Tengah',
2265 '08' => 'Jawa Timur',
2266 '10' => 'Yogyakarta',
2267 '11' => 'Kalimantan Barat',
2268 '12' => 'Kalimantan Selatan',
2269 '13' => 'Kalimantan Tengah',
2270 '14' => 'Kalimantan Timur',
2271 '15' => 'Lampung',
2272 '17' => 'Nusa Tenggara Barat',
2273 '18' => 'Nusa Tenggara Timur',
2274 '21' => 'Sulawesi Tengah',
2275 '22' => 'Sulawesi Tenggara',
2276 '24' => 'Sumatera Barat',
2277 '26' => 'Sumatera Utara',
2278 '28' => 'Maluku',
2279 '29' => 'Maluku Utara',
2280 '30' => 'Jawa Barat',
2281 '31' => 'Sulawesi Utara',
2282 '32' => 'Sumatera Selatan',
2283 '33' => 'Banten',
2284 '34' => 'Gorontalo',
2285 '35' => 'Kepulauan Bangka Belitung',
2286 '36' => 'Papua',
2287 '37' => 'Riau',
2288 '38' => 'Sulawesi Selatan',
2289 '39' => 'Irian Jaya Barat',
2290 '40' => 'Kepulauan Riau',
2291 '41' => 'Sulawesi Barat'
2292 },
2293 'IE' => {
2294 '01' => 'Carlow',
2295 '02' => 'Cavan',
2296 '03' => 'Clare',
2297 '04' => 'Cork',
2298 '06' => 'Donegal',
2299 '07' => 'Dublin',
2300 '10' => 'Galway',
2301 '11' => 'Kerry',
2302 '12' => 'Kildare',
2303 '13' => 'Kilkenny',
2304 '14' => 'Leitrim',
2305 '15' => 'Laois',
2306 '16' => 'Limerick',
2307 '18' => 'Longford',
2308 '19' => 'Louth',
2309 '20' => 'Mayo',
2310 '21' => 'Meath',
2311 '22' => 'Monaghan',
2312 '23' => 'Offaly',
2313 '24' => 'Roscommon',
2314 '25' => 'Sligo',
2315 '26' => 'Tipperary',
2316 '27' => 'Waterford',
2317 '29' => 'Westmeath',
2318 '30' => 'Wexford',
2319 '31' => 'Wicklow'
2320 },
2321 'IL' => {
2322 '01' => 'HaDarom',
2323 '02' => 'HaMerkaz',
2324 '03' => 'HaZafon',
2325 '04' => 'Hefa',
2326 '05' => 'Tel Aviv',
2327 '06' => 'Yerushalayim'
2328 },
2329 'IN' => {
2330 '01' => 'Andaman and Nicobar Islands',
2331 '02' => 'Andhra Pradesh',
2332 '03' => 'Assam',
2333 '05' => 'Chandigarh',
2334 '06' => 'Dadra and Nagar Haveli',
2335 '07' => 'Delhi',
2336 '09' => 'Gujarat',
2337 '10' => 'Haryana',
2338 '11' => 'Himachal Pradesh',
2339 '12' => 'Jammu and Kashmir',
2340 '13' => 'Kerala',
2341 '14' => 'Lakshadweep',
2342 '16' => 'Maharashtra',
2343 '17' => 'Manipur',
2344 '18' => 'Meghalaya',
2345 '19' => 'Karnataka',
2346 '20' => 'Nagaland',
2347 '21' => 'Orissa',
2348 '22' => 'Puducherry',
2349 '23' => 'Punjab',
2350 '24' => 'Rajasthan',
2351 '25' => 'Tamil Nadu',
2352 '26' => 'Tripura',
2353 '28' => 'West Bengal',
2354 '29' => 'Sikkim',
2355 '30' => 'Arunachal Pradesh',
2356 '31' => 'Mizoram',
2357 '32' => 'Daman and Diu',
2358 '33' => 'Goa',
2359 '34' => 'Bihar',
2360 '35' => 'Madhya Pradesh',
2361 '36' => 'Uttar Pradesh',
2362 '37' => 'Chhattisgarh',
2363 '38' => 'Jharkhand',
2364 '39' => 'Uttarakhand'
2365 },
2366 'IQ' => {
2367 '01' => 'Al Anbar',
2368 '02' => 'Al Basrah',
2369 '03' => 'Al Muthanna',
2370 '04' => 'Al Qadisiyah',
2371 '05' => 'As Sulaymaniyah',
2372 '06' => 'Babil',
2373 '07' => 'Baghdad',
2374 '08' => 'Dahuk',
2375 '09' => 'Dhi Qar',
2376 '10' => 'Diyala',
2377 '11' => 'Arbil',
2378 '12' => 'Karbala\'',
2379 '13' => 'At Ta\'mim',
2380 '14' => 'Maysan',
2381 '15' => 'Ninawa',
2382 '16' => 'Wasit',
2383 '17' => 'An Najaf',
2384 '18' => 'Salah ad Din'
2385 },
2386 'IR' => {
2387 '01' => 'Azarbayjan-e Bakhtari',
2388 '03' => 'Chahar Mahall va Bakhtiari',
2389 '04' => 'Sistan va Baluchestan',
2390 '05' => 'Kohkiluyeh va Buyer Ahmadi',
2391 '07' => 'Fars',
2392 '08' => 'Gilan',
2393 '09' => 'Hamadan',
2394 '10' => 'Ilam',
2395 '11' => 'Hormozgan',
2396 '12' => 'Kerman',
2397 '13' => 'Bakhtaran',
2398 '15' => 'Khuzestan',
2399 '16' => 'Kordestan',
2400 '17' => 'Mazandaran',
2401 '18' => 'Semnan Province',
2402 '19' => 'Markazi',
2403 '21' => 'Zanjan',
2404 '22' => 'Bushehr',
2405 '23' => 'Lorestan',
2406 '24' => 'Markazi',
2407 '25' => 'Semnan',
2408 '26' => 'Tehran',
2409 '27' => 'Zanjan',
2410 '28' => 'Esfahan',
2411 '29' => 'Kerman',
2412 '30' => 'Khorasan',
2413 '31' => 'Yazd',
2414 '32' => 'Ardabil',
2415 '33' => 'East Azarbaijan',
2416 '34' => 'Markazi',
2417 '35' => 'Mazandaran',
2418 '36' => 'Zanjan',
2419 '37' => 'Golestan',
2420 '38' => 'Qazvin',
2421 '39' => 'Qom',
2422 '40' => 'Yazd',
2423 '41' => 'Khorasan-e Janubi',
2424 '42' => 'Khorasan-e Razavi',
2425 '43' => 'Khorasan-e Shemali',
2426 '44' => 'Alborz'
2427 },
2428 'IS' => {
2429 '03' => 'Arnessysla',
2430 '05' => 'Austur-Hunavatnssysla',
2431 '06' => 'Austur-Skaftafellssysla',
2432 '07' => 'Borgarfjardarsysla',
2433 '09' => 'Eyjafjardarsysla',
2434 '10' => 'Gullbringusysla',
2435 '15' => 'Kjosarsysla',
2436 '17' => 'Myrasysla',
2437 '20' => 'Nordur-Mulasysla',
2438 '21' => 'Nordur-Tingeyjarsysla',
2439 '23' => 'Rangarvallasysla',
2440 '28' => 'Skagafjardarsysla',
2441 '29' => 'Snafellsnes- og Hnappadalssysla',
2442 '30' => 'Strandasysla',
2443 '31' => 'Sudur-Mulasysla',
2444 '32' => 'Sudur-Tingeyjarsysla',
2445 '34' => 'Vestur-Bardastrandarsysla',
2446 '35' => 'Vestur-Hunavatnssysla',
2447 '36' => 'Vestur-Isafjardarsysla',
2448 '37' => 'Vestur-Skaftafellssysla',
2449 '38' => 'Austurland',
2450 '39' => 'Hofuoborgarsvaoio',
2451 '40' => 'Norourland Eystra',
2452 '41' => 'Norourland Vestra',
2453 '42' => 'Suourland',
2454 '43' => 'Suournes',
2455 '44' => 'Vestfiroir',
2456 '45' => 'Vesturland'
2457 },
2458 'IT' => {
2459 '01' => 'Abruzzi',
2460 '02' => 'Basilicata',
2461 '03' => 'Calabria',
2462 '04' => 'Campania',
2463 '05' => 'Emilia-Romagna',
2464 '06' => 'Friuli-Venezia Giulia',
2465 '07' => 'Lazio',
2466 '08' => 'Liguria',
2467 '09' => 'Lombardia',
2468 '10' => 'Marche',
2469 '11' => 'Molise',
2470 '12' => 'Piemonte',
2471 '13' => 'Puglia',
2472 '14' => 'Sardegna',
2473 '15' => 'Sicilia',
2474 '16' => 'Toscana',
2475 '17' => 'Trentino-Alto Adige',
2476 '18' => 'Umbria',
2477 '19' => 'Valle d\'Aosta',
2478 '20' => 'Veneto'
2479 },
2480 'JM' => {
2481 '01' => 'Clarendon',
2482 '02' => 'Hanover',
2483 '04' => 'Manchester',
2484 '07' => 'Portland',
2485 '08' => 'Saint Andrew',
2486 '09' => 'Saint Ann',
2487 '10' => 'Saint Catherine',
2488 '11' => 'Saint Elizabeth',
2489 '12' => 'Saint James',
2490 '13' => 'Saint Mary',
2491 '14' => 'Saint Thomas',
2492 '15' => 'Trelawny',
2493 '16' => 'Westmoreland',
2494 '17' => 'Kingston'
2495 },
2496 'JO' => {
2497 '02' => 'Al Balqa\'',
2498 '09' => 'Al Karak',
2499 '12' => 'At Tafilah',
2500 '15' => 'Al Mafraq',
2501 '16' => 'Amman',
2502 '17' => 'Az Zaraqa',
2503 '18' => 'Irbid',
2504 '19' => 'Ma\'an',
2505 '20' => 'Ajlun',
2506 '21' => 'Al Aqabah',
2507 '22' => 'Jarash',
2508 '23' => 'Madaba'
2509 },
2510 'JP' => {
2511 '01' => 'Aichi',
2512 '02' => 'Akita',
2513 '03' => 'Aomori',
2514 '04' => 'Chiba',
2515 '05' => 'Ehime',
2516 '06' => 'Fukui',
2517 '07' => 'Fukuoka',
2518 '08' => 'Fukushima',
2519 '09' => 'Gifu',
2520 '10' => 'Gumma',
2521 '11' => 'Hiroshima',
2522 '12' => 'Hokkaido',
2523 '13' => 'Hyogo',
2524 '14' => 'Ibaraki',
2525 '15' => 'Ishikawa',
2526 '16' => 'Iwate',
2527 '17' => 'Kagawa',
2528 '18' => 'Kagoshima',
2529 '19' => 'Kanagawa',
2530 '20' => 'Kochi',
2531 '21' => 'Kumamoto',
2532 '22' => 'Kyoto',
2533 '23' => 'Mie',
2534 '24' => 'Miyagi',
2535 '25' => 'Miyazaki',
2536 '26' => 'Nagano',
2537 '27' => 'Nagasaki',
2538 '28' => 'Nara',
2539 '29' => 'Niigata',
2540 '30' => 'Oita',
2541 '31' => 'Okayama',
2542 '32' => 'Osaka',
2543 '33' => 'Saga',
2544 '34' => 'Saitama',
2545 '35' => 'Shiga',
2546 '36' => 'Shimane',
2547 '37' => 'Shizuoka',
2548 '38' => 'Tochigi',
2549 '39' => 'Tokushima',
2550 '40' => 'Tokyo',
2551 '41' => 'Tottori',
2552 '42' => 'Toyama',
2553 '43' => 'Wakayama',
2554 '44' => 'Yamagata',
2555 '45' => 'Yamaguchi',
2556 '46' => 'Yamanashi',
2557 '47' => 'Okinawa'
2558 },
2559 'KE' => {
2560 '01' => 'Central',
2561 '02' => 'Coast',
2562 '03' => 'Eastern',
2563 '05' => 'Nairobi Area',
2564 '06' => 'North-Eastern',
2565 '07' => 'Nyanza',
2566 '08' => 'Rift Valley',
2567 '09' => 'Western'
2568 },
2569 'KG' => {
2570 '01' => 'Bishkek',
2571 '02' => 'Chuy',
2572 '03' => 'Jalal-Abad',
2573 '04' => 'Naryn',
2574 '05' => 'Osh',
2575 '06' => 'Talas',
2576 '07' => 'Ysyk-Kol',
2577 '08' => 'Osh',
2578 '09' => 'Batken'
2579 },
2580 'KH' => {
2581 '01' => 'Batdambang',
2582 '02' => 'Kampong Cham',
2583 '03' => 'Kampong Chhnang',
2584 '04' => 'Kampong Speu',
2585 '05' => 'Kampong Thum',
2586 '06' => 'Kampot',
2587 '07' => 'Kandal',
2588 '08' => 'Koh Kong',
2589 '09' => 'Kracheh',
2590 '10' => 'Mondulkiri',
2591 '11' => 'Phnum Penh',
2592 '12' => 'Pursat',
2593 '13' => 'Preah Vihear',
2594 '14' => 'Prey Veng',
2595 '15' => 'Ratanakiri Kiri',
2596 '16' => 'Siem Reap',
2597 '17' => 'Stung Treng',
2598 '18' => 'Svay Rieng',
2599 '19' => 'Takeo',
2600 '22' => 'Phnum Penh',
2601 '23' => 'Ratanakiri',
2602 '25' => 'Banteay Meanchey',
2603 '28' => 'Preah Seihanu',
2604 '29' => 'Batdambang',
2605 '30' => 'Pailin'
2606 },
2607 'KI' => {
2608 '01' => 'Gilbert Islands',
2609 '02' => 'Line Islands',
2610 '03' => 'Phoenix Islands'
2611 },
2612 'KM' => {
2613 '01' => 'Anjouan',
2614 '02' => 'Grande Comore',
2615 '03' => 'Moheli'
2616 },
2617 'KN' => {
2618 '01' => 'Christ Church Nichola Town',
2619 '02' => 'Saint Anne Sandy Point',
2620 '03' => 'Saint George Basseterre',
2621 '04' => 'Saint George Gingerland',
2622 '05' => 'Saint James Windward',
2623 '06' => 'Saint John Capisterre',
2624 '07' => 'Saint John Figtree',
2625 '08' => 'Saint Mary Cayon',
2626 '09' => 'Saint Paul Capisterre',
2627 '10' => 'Saint Paul Charlestown',
2628 '11' => 'Saint Peter Basseterre',
2629 '12' => 'Saint Thomas Lowland',
2630 '13' => 'Saint Thomas Middle Island',
2631 '15' => 'Trinity Palmetto Point'
2632 },
2633 'KP' => {
2634 '01' => 'Chagang-do',
2635 '03' => 'Hamgyong-namdo',
2636 '06' => 'Hwanghae-namdo',
2637 '07' => 'Hwanghae-bukto',
2638 '08' => 'Kaesong-si',
2639 '09' => 'Kangwon-do',
2640 '11' => 'P\'yongan-bukto',
2641 '12' => 'P\'yongyang-si',
2642 '13' => 'Yanggang-do',
2643 '14' => 'Namp\'o-si',
2644 '15' => 'P\'yongan-namdo',
2645 '17' => 'Hamgyong-bukto',
2646 '18' => 'Najin Sonbong-si'
2647 },
2648 'KR' => {
2649 '01' => 'Cheju-do',
2650 '03' => 'Cholla-bukto',
2651 '05' => 'Ch\'ungch\'ong-bukto',
2652 '06' => 'Kangwon-do',
2653 '10' => 'Pusan-jikhalsi',
2654 '11' => 'Seoul-t\'ukpyolsi',
2655 '12' => 'Inch\'on-jikhalsi',
2656 '13' => 'Kyonggi-do',
2657 '14' => 'Kyongsang-bukto',
2658 '15' => 'Taegu-jikhalsi',
2659 '16' => 'Cholla-namdo',
2660 '17' => 'Ch\'ungch\'ong-namdo',
2661 '18' => 'Kwangju-jikhalsi',
2662 '19' => 'Taejon-jikhalsi',
2663 '20' => 'Kyongsang-namdo',
2664 '21' => 'Ulsan-gwangyoksi'
2665 },
2666 'KW' => {
2667 '01' => 'Al Ahmadi',
2668 '02' => 'Al Kuwayt',
2669 '05' => 'Al Jahra',
2670 '07' => 'Al Farwaniyah',
2671 '08' => 'Hawalli',
2672 '09' => 'Mubarak al Kabir'
2673 },
2674 'KY' => {
2675 '01' => 'Creek',
2676 '02' => 'Eastern',
2677 '03' => 'Midland',
2678 '04' => 'South Town',
2679 '05' => 'Spot Bay',
2680 '06' => 'Stake Bay',
2681 '07' => 'West End',
2682 '08' => 'Western'
2683 },
2684 'KZ' => {
2685 '01' => 'Almaty',
2686 '02' => 'Almaty City',
2687 '03' => 'Aqmola',
2688 '04' => 'Aqtobe',
2689 '05' => 'Astana',
2690 '06' => 'Atyrau',
2691 '07' => 'West Kazakhstan',
2692 '08' => 'Bayqonyr',
2693 '09' => 'Mangghystau',
2694 '10' => 'South Kazakhstan',
2695 '11' => 'Pavlodar',
2696 '12' => 'Qaraghandy',
2697 '13' => 'Qostanay',
2698 '14' => 'Qyzylorda',
2699 '15' => 'East Kazakhstan',
2700 '16' => 'North Kazakhstan',
2701 '17' => 'Zhambyl'
2702 },
2703 'LA' => {
2704 '01' => 'Attapu',
2705 '02' => 'Champasak',
2706 '03' => 'Houaphan',
2707 '04' => 'Khammouan',
2708 '05' => 'Louang Namtha',
2709 '07' => 'Oudomxai',
2710 '08' => 'Phongsali',
2711 '09' => 'Saravan',
2712 '10' => 'Savannakhet',
2713 '11' => 'Vientiane',
2714 '13' => 'Xaignabouri',
2715 '14' => 'Xiangkhoang',
2716 '17' => 'Louangphrabang'
2717 },
2718 'LB' => {
2719 '01' => 'Beqaa',
2720 '02' => 'Al Janub',
2721 '03' => 'Liban-Nord',
2722 '04' => 'Beyrouth',
2723 '05' => 'Mont-Liban',
2724 '06' => 'Liban-Sud',
2725 '07' => 'Nabatiye',
2726 '08' => 'Beqaa',
2727 '09' => 'Liban-Nord',
2728 '10' => 'Aakk,r',
2729 '11' => 'Baalbek-Hermel'
2730 },
2731 'LC' => {
2732 '01' => 'Anse-la-Raye',
2733 '02' => 'Dauphin',
2734 '03' => 'Castries',
2735 '04' => 'Choiseul',
2736 '05' => 'Dennery',
2737 '06' => 'Gros-Islet',
2738 '07' => 'Laborie',
2739 '08' => 'Micoud',
2740 '09' => 'Soufriere',
2741 '10' => 'Vieux-Fort',
2742 '11' => 'Praslin'
2743 },
2744 'LI' => {
2745 '01' => 'Balzers',
2746 '02' => 'Eschen',
2747 '03' => 'Gamprin',
2748 '04' => 'Mauren',
2749 '05' => 'Planken',
2750 '06' => 'Ruggell',
2751 '07' => 'Schaan',
2752 '08' => 'Schellenberg',
2753 '09' => 'Triesen',
2754 '10' => 'Triesenberg',
2755 '11' => 'Vaduz',
2756 '21' => 'Gbarpolu',
2757 '22' => 'River Gee'
2758 },
2759 'LK' => {
2760 '29' => 'Central',
2761 '30' => 'North Central',
2762 '32' => 'North Western',
2763 '33' => 'Sabaragamuwa',
2764 '34' => 'Southern',
2765 '35' => 'Uva',
2766 '36' => 'Western',
2767 '37' => 'Eastern',
2768 '38' => 'Northern'
2769 },
2770 'LR' => {
2771 '01' => 'Bong',
2772 '04' => 'Grand Cape Mount',
2773 '05' => 'Lofa',
2774 '06' => 'Maryland',
2775 '07' => 'Monrovia',
2776 '09' => 'Nimba',
2777 '10' => 'Sino',
2778 '11' => 'Grand Bassa',
2779 '12' => 'Grand Cape Mount',
2780 '13' => 'Maryland',
2781 '14' => 'Montserrado',
2782 '17' => 'Margibi',
2783 '18' => 'River Cess',
2784 '19' => 'Grand Gedeh',
2785 '20' => 'Lofa',
2786 '21' => 'Gbarpolu',
2787 '22' => 'River Gee'
2788 },
2789 'LS' => {
2790 '10' => 'Berea',
2791 '11' => 'Butha-Buthe',
2792 '12' => 'Leribe',
2793 '13' => 'Mafeteng',
2794 '14' => 'Maseru',
2795 '15' => 'Mohales Hoek',
2796 '16' => 'Mokhotlong',
2797 '17' => 'Qachas Nek',
2798 '18' => 'Quthing',
2799 '19' => 'Thaba-Tseka'
2800 },
2801 'LT' => {
2802 '56' => 'Alytaus Apskritis',
2803 '57' => 'Kauno Apskritis',
2804 '58' => 'Klaipedos Apskritis',
2805 '59' => 'Marijampoles Apskritis',
2806 '60' => 'Panevezio Apskritis',
2807 '61' => 'Siauliu Apskritis',
2808 '62' => 'Taurages Apskritis',
2809 '63' => 'Telsiu Apskritis',
2810 '64' => 'Utenos Apskritis',
2811 '65' => 'Vilniaus Apskritis'
2812 },
2813 'LU' => {
2814 '01' => 'Diekirch',
2815 '02' => 'Grevenmacher',
2816 '03' => 'Luxembourg'
2817 },
2818 'LV' => {
2819 '01' => 'Aizkraukles',
2820 '02' => 'Aluksnes',
2821 '03' => 'Balvu',
2822 '04' => 'Bauskas',
2823 '05' => 'Cesu',
2824 '06' => 'Daugavpils',
2825 '07' => 'Daugavpils',
2826 '08' => 'Dobeles',
2827 '09' => 'Gulbenes',
2828 '10' => 'Jekabpils',
2829 '11' => 'Jelgava',
2830 '12' => 'Jelgavas',
2831 '13' => 'Jurmala',
2832 '14' => 'Kraslavas',
2833 '15' => 'Kuldigas',
2834 '16' => 'Liepaja',
2835 '17' => 'Liepajas',
2836 '18' => 'Limbazu',
2837 '19' => 'Ludzas',
2838 '20' => 'Madonas',
2839 '21' => 'Ogres',
2840 '22' => 'Preilu',
2841 '23' => 'Rezekne',
2842 '24' => 'Rezeknes',
2843 '25' => 'Riga',
2844 '26' => 'Rigas',
2845 '27' => 'Saldus',
2846 '28' => 'Talsu',
2847 '29' => 'Tukuma',
2848 '30' => 'Valkas',
2849 '31' => 'Valmieras',
2850 '32' => 'Ventspils',
2851 '33' => 'Ventspils'
2852 },
2853 'LY' => {
2854 '03' => 'Al Aziziyah',
2855 '05' => 'Al Jufrah',
2856 '08' => 'Al Kufrah',
2857 '13' => 'Ash Shati\'',
2858 '30' => 'Murzuq',
2859 '34' => 'Sabha',
2860 '41' => 'Tarhunah',
2861 '42' => 'Tubruq',
2862 '45' => 'Zlitan',
2863 '47' => 'Ajdabiya',
2864 '48' => 'Al Fatih',
2865 '49' => 'Al Jabal al Akhdar',
2866 '50' => 'Al Khums',
2867 '51' => 'An Nuqat al Khams',
2868 '52' => 'Awbari',
2869 '53' => 'Az Zawiyah',
2870 '54' => 'Banghazi',
2871 '55' => 'Darnah',
2872 '56' => 'Ghadamis',
2873 '57' => 'Gharyan',
2874 '58' => 'Misratah',
2875 '59' => 'Sawfajjin',
2876 '60' => 'Surt',
2877 '61' => 'Tarabulus',
2878 '62' => 'Yafran'
2879 },
2880 'MA' => {
2881 '45' => 'Grand Casablanca',
2882 '46' => 'Fes-Boulemane',
2883 '47' => 'Marrakech-Tensift-Al Haouz',
2884 '48' => 'Meknes-Tafilalet',
2885 '49' => 'Rabat-Sale-Zemmour-Zaer',
2886 '50' => 'Chaouia-Ouardigha',
2887 '51' => 'Doukkala-Abda',
2888 '52' => 'Gharb-Chrarda-Beni Hssen',
2889 '53' => 'Guelmim-Es Smara',
2890 '54' => 'Oriental',
2891 '55' => 'Souss-Massa-Dr,a',
2892 '56' => 'Tadla-Azilal',
2893 '57' => 'Tanger-Tetouan',
2894 '58' => 'Taza-Al Hoceima-Taounate',
2895 '59' => 'La,youne-Boujdour-Sakia El Hamra'
2896 },
2897 'MC' => {
2898 '01' => 'La Condamine',
2899 '02' => 'Monaco',
2900 '03' => 'Monte-Carlo'
2901 },
2902 'MD' => {
2903 '51' => 'Gagauzia',
2904 '57' => 'Chisinau',
2905 '58' => 'Stinga Nistrului',
2906 '59' => 'Anenii Noi',
2907 '60' => 'Balti',
2908 '61' => 'Basarabeasca',
2909 '62' => 'Bender',
2910 '63' => 'Briceni',
2911 '64' => 'Cahul',
2912 '65' => 'Cantemir',
2913 '66' => 'Calarasi',
2914 '67' => 'Causeni',
2915 '68' => 'Cimislia',
2916 '69' => 'Criuleni',
2917 '70' => 'Donduseni',
2918 '71' => 'Drochia',
2919 '72' => 'Dubasari',
2920 '73' => 'Edinet',
2921 '74' => 'Falesti',
2922 '75' => 'Floresti',
2923 '76' => 'Glodeni',
2924 '77' => 'Hincesti',
2925 '78' => 'Ialoveni',
2926 '79' => 'Leova',
2927 '80' => 'Nisporeni',
2928 '81' => 'Ocnita',
2929 '82' => 'Orhei',
2930 '83' => 'Rezina',
2931 '84' => 'Riscani',
2932 '85' => 'Singerei',
2933 '86' => 'Soldanesti',
2934 '87' => 'Soroca',
2935 '88' => 'Stefan-Voda',
2936 '89' => 'Straseni',
2937 '90' => 'Taraclia',
2938 '91' => 'Telenesti',
2939 '92' => 'Ungheni'
2940 },
2941 'MG' => {
2942 '01' => 'Antsiranana',
2943 '02' => 'Fianarantsoa',
2944 '03' => 'Mahajanga',
2945 '04' => 'Toamasina',
2946 '05' => 'Antananarivo',
2947 '06' => 'Toliara'
2948 },
2949 'MK' => {
2950 '01' => 'Aracinovo',
2951 '02' => 'Bac',
2952 '03' => 'Belcista',
2953 '04' => 'Berovo',
2954 '05' => 'Bistrica',
2955 '06' => 'Bitola',
2956 '07' => 'Blatec',
2957 '08' => 'Bogdanci',
2958 '09' => 'Bogomila',
2959 '10' => 'Bogovinje',
2960 '11' => 'Bosilovo',
2961 '12' => 'Brvenica',
2962 '13' => 'Cair',
2963 '14' => 'Capari',
2964 '15' => 'Caska',
2965 '16' => 'Cegrane',
2966 '17' => 'Centar',
2967 '18' => 'Centar Zupa',
2968 '19' => 'Cesinovo',
2969 '20' => 'Cucer-Sandevo',
2970 '21' => 'Debar',
2971 '22' => 'Delcevo',
2972 '23' => 'Delogozdi',
2973 '24' => 'Demir Hisar',
2974 '25' => 'Demir Kapija',
2975 '26' => 'Dobrusevo',
2976 '27' => 'Dolna Banjica',
2977 '28' => 'Dolneni',
2978 '29' => 'Dorce Petrov',
2979 '30' => 'Drugovo',
2980 '31' => 'Dzepciste',
2981 '32' => 'Gazi Baba',
2982 '33' => 'Gevgelija',
2983 '34' => 'Gostivar',
2984 '35' => 'Gradsko',
2985 '36' => 'Ilinden',
2986 '37' => 'Izvor',
2987 '38' => 'Jegunovce',
2988 '39' => 'Kamenjane',
2989 '40' => 'Karbinci',
2990 '41' => 'Karpos',
2991 '42' => 'Kavadarci',
2992 '43' => 'Kicevo',
2993 '44' => 'Kisela Voda',
2994 '45' => 'Klecevce',
2995 '46' => 'Kocani',
2996 '47' => 'Konce',
2997 '48' => 'Kondovo',
2998 '49' => 'Konopiste',
2999 '50' => 'Kosel',
3000 '51' => 'Kratovo',
3001 '52' => 'Kriva Palanka',
3002 '53' => 'Krivogastani',
3003 '54' => 'Krusevo',
3004 '55' => 'Kuklis',
3005 '56' => 'Kukurecani',
3006 '57' => 'Kumanovo',
3007 '58' => 'Labunista',
3008 '59' => 'Lipkovo',
3009 '60' => 'Lozovo',
3010 '61' => 'Lukovo',
3011 '62' => 'Makedonska Kamenica',
3012 '63' => 'Makedonski Brod',
3013 '64' => 'Mavrovi Anovi',
3014 '65' => 'Meseista',
3015 '66' => 'Miravci',
3016 '67' => 'Mogila',
3017 '68' => 'Murtino',
3018 '69' => 'Negotino',
3019 '70' => 'Negotino-Polosko',
3020 '71' => 'Novaci',
3021 '72' => 'Novo Selo',
3022 '73' => 'Oblesevo',
3023 '74' => 'Ohrid',
3024 '75' => 'Orasac',
3025 '76' => 'Orizari',
3026 '77' => 'Oslomej',
3027 '78' => 'Pehcevo',
3028 '79' => 'Petrovec',
3029 '80' => 'Plasnica',
3030 '81' => 'Podares',
3031 '82' => 'Prilep',
3032 '83' => 'Probistip',
3033 '84' => 'Radovis',
3034 '85' => 'Rankovce',
3035 '86' => 'Resen',
3036 '87' => 'Rosoman',
3037 '88' => 'Rostusa',
3038 '89' => 'Samokov',
3039 '90' => 'Saraj',
3040 '91' => 'Sipkovica',
3041 '92' => 'Sopiste',
3042 '93' => 'Sopotnica',
3043 '94' => 'Srbinovo',
3044 '95' => 'Staravina',
3045 '96' => 'Star Dojran',
3046 '97' => 'Staro Nagoricane',
3047 '98' => 'Stip',
3048 '99' => 'Struga',
3049 'A1' => 'Strumica',
3050 'A2' => 'Studenicani',
3051 'A3' => 'Suto Orizari',
3052 'A4' => 'Sveti Nikole',
3053 'A5' => 'Tearce',
3054 'A6' => 'Tetovo',
3055 'A7' => 'Topolcani',
3056 'A8' => 'Valandovo',
3057 'A9' => 'Vasilevo',
3058 'B1' => 'Veles',
3059 'B2' => 'Velesta',
3060 'B3' => 'Vevcani',
3061 'B4' => 'Vinica',
3062 'B5' => 'Vitoliste',
3063 'B6' => 'Vranestica',
3064 'B7' => 'Vrapciste',
3065 'B8' => 'Vratnica',
3066 'B9' => 'Vrutok',
3067 'C1' => 'Zajas',
3068 'C2' => 'Zelenikovo',
3069 'C3' => 'Zelino',
3070 'C4' => 'Zitose',
3071 'C5' => 'Zletovo',
3072 'C6' => 'Zrnovci',
3073 'C8' => 'Cair',
3074 'C9' => 'Caska',
3075 'D2' => 'Debar',
3076 'D3' => 'Demir Hisar',
3077 'D4' => 'Gostivar',
3078 'D5' => 'Jegunovce',
3079 'D6' => 'Kavadarci',
3080 'D7' => 'Kumanovo',
3081 'D8' => 'Makedonski Brod',
3082 'E2' => 'Ohrid',
3083 'E3' => 'Prilep',
3084 'E5' => 'Dojran',
3085 'E6' => 'Struga',
3086 'E7' => 'Strumica',
3087 'E8' => 'Tetovo',
3088 'E9' => 'Valandovo',
3089 'F1' => 'Veles',
3090 'F2' => 'Aerodrom'
3091 },
3092 'ML' => {
3093 '01' => 'Bamako',
3094 '03' => 'Kayes',
3095 '04' => 'Mopti',
3096 '05' => 'Segou',
3097 '06' => 'Sikasso',
3098 '07' => 'Koulikoro',
3099 '08' => 'Tombouctou',
3100 '09' => 'Gao',
3101 '10' => 'Kidal'
3102 },
3103 'MM' => {
3104 '01' => 'Rakhine State',
3105 '02' => 'Chin State',
3106 '03' => 'Irrawaddy',
3107 '04' => 'Kachin State',
3108 '05' => 'Karan State',
3109 '06' => 'Kayah State',
3110 '07' => 'Magwe',
3111 '08' => 'Mandalay',
3112 '09' => 'Pegu',
3113 '10' => 'Sagaing',
3114 '11' => 'Shan State',
3115 '12' => 'Tenasserim',
3116 '13' => 'Mon State',
3117 '14' => 'Rangoon',
3118 '17' => 'Yangon'
3119 },
3120 'MN' => {
3121 '01' => 'Arhangay',
3122 '02' => 'Bayanhongor',
3123 '03' => 'Bayan-Olgiy',
3124 '05' => 'Darhan',
3125 '06' => 'Dornod',
3126 '07' => 'Dornogovi',
3127 '08' => 'Dundgovi',
3128 '09' => 'Dzavhan',
3129 '10' => 'Govi-Altay',
3130 '11' => 'Hentiy',
3131 '12' => 'Hovd',
3132 '13' => 'Hovsgol',
3133 '14' => 'Omnogovi',
3134 '15' => 'Ovorhangay',
3135 '16' => 'Selenge',
3136 '17' => 'Suhbaatar',
3137 '18' => 'Tov',
3138 '19' => 'Uvs',
3139 '20' => 'Ulaanbaatar',
3140 '21' => 'Bulgan',
3141 '22' => 'Erdenet',
3142 '23' => 'Darhan-Uul',
3143 '24' => 'Govisumber',
3144 '25' => 'Orhon'
3145 },
3146 'MO' => {
3147 '01' => 'Ilhas',
3148 '02' => 'Macau'
3149 },
3150 'MR' => {
3151 '01' => 'Hodh Ech Chargui',
3152 '02' => 'Hodh El Gharbi',
3153 '03' => 'Assaba',
3154 '04' => 'Gorgol',
3155 '05' => 'Brakna',
3156 '06' => 'Trarza',
3157 '07' => 'Adrar',
3158 '08' => 'Dakhlet Nouadhibou',
3159 '09' => 'Tagant',
3160 '10' => 'Guidimaka',
3161 '11' => 'Tiris Zemmour',
3162 '12' => 'Inchiri'
3163 },
3164 'MS' => {
3165 '01' => 'Saint Anthony',
3166 '02' => 'Saint Georges',
3167 '03' => 'Saint Peter'
3168 },
3169 'MU' => {
3170 '12' => 'Black River',
3171 '13' => 'Flacq',
3172 '14' => 'Grand Port',
3173 '15' => 'Moka',
3174 '16' => 'Pamplemousses',
3175 '17' => 'Plaines Wilhems',
3176 '18' => 'Port Louis',
3177 '19' => 'Riviere du Rempart',
3178 '20' => 'Savanne',
3179 '21' => 'Agalega Islands',
3180 '22' => 'Cargados Carajos',
3181 '23' => 'Rodrigues'
3182 },
3183 'MV' => {
3184 '01' => 'Seenu',
3185 '05' => 'Laamu',
3186 '30' => 'Alifu',
3187 '31' => 'Baa',
3188 '32' => 'Dhaalu',
3189 '33' => 'Faafu ',
3190 '34' => 'Gaafu Alifu',
3191 '35' => 'Gaafu Dhaalu',
3192 '36' => 'Haa Alifu',
3193 '37' => 'Haa Dhaalu',
3194 '38' => 'Kaafu',
3195 '39' => 'Lhaviyani',
3196 '40' => 'Maale',
3197 '41' => 'Meemu',
3198 '42' => 'Gnaviyani',
3199 '43' => 'Noonu',
3200 '44' => 'Raa',
3201 '45' => 'Shaviyani',
3202 '46' => 'Thaa',
3203 '47' => 'Vaavu'
3204 },
3205 'MW' => {
3206 '02' => 'Chikwawa',
3207 '03' => 'Chiradzulu',
3208 '04' => 'Chitipa',
3209 '05' => 'Thyolo',
3210 '06' => 'Dedza',
3211 '07' => 'Dowa',
3212 '08' => 'Karonga',
3213 '09' => 'Kasungu',
3214 '11' => 'Lilongwe',
3215 '12' => 'Mangochi',
3216 '13' => 'Mchinji',
3217 '15' => 'Mzimba',
3218 '16' => 'Ntcheu',
3219 '17' => 'Nkhata Bay',
3220 '18' => 'Nkhotakota',
3221 '19' => 'Nsanje',
3222 '20' => 'Ntchisi',
3223 '21' => 'Rumphi',
3224 '22' => 'Salima',
3225 '23' => 'Zomba',
3226 '24' => 'Blantyre',
3227 '25' => 'Mwanza',
3228 '26' => 'Balaka',
3229 '27' => 'Likoma',
3230 '28' => 'Machinga',
3231 '29' => 'Mulanje',
3232 '30' => 'Phalombe'
3233 },
3234 'MX' => {
3235 '01' => 'Aguascalientes',
3236 '02' => 'Baja California',
3237 '03' => 'Baja California Sur',
3238 '04' => 'Campeche',
3239 '05' => 'Chiapas',
3240 '06' => 'Chihuahua',
3241 '07' => 'Coahuila de Zaragoza',
3242 '08' => 'Colima',
3243 '09' => 'Distrito Federal',
3244 '10' => 'Durango',
3245 '11' => 'Guanajuato',
3246 '12' => 'Guerrero',
3247 '13' => 'Hidalgo',
3248 '14' => 'Jalisco',
3249 '15' => 'Mexico',
3250 '16' => 'Michoacan de Ocampo',
3251 '17' => 'Morelos',
3252 '18' => 'Nayarit',
3253 '19' => 'Nuevo Leon',
3254 '20' => 'Oaxaca',
3255 '21' => 'Puebla',
3256 '22' => 'Queretaro de Arteaga',
3257 '23' => 'Quintana Roo',
3258 '24' => 'San Luis Potosi',
3259 '25' => 'Sinaloa',
3260 '26' => 'Sonora',
3261 '27' => 'Tabasco',
3262 '28' => 'Tamaulipas',
3263 '29' => 'Tlaxcala',
3264 '30' => 'Veracruz-Llave',
3265 '31' => 'Yucatan',
3266 '32' => 'Zacatecas'
3267 },
3268 'MY' => {
3269 '01' => 'Johor',
3270 '02' => 'Kedah',
3271 '03' => 'Kelantan',
3272 '04' => 'Melaka',
3273 '05' => 'Negeri Sembilan',
3274 '06' => 'Pahang',
3275 '07' => 'Perak',
3276 '08' => 'Perlis',
3277 '09' => 'Pulau Pinang',
3278 '11' => 'Sarawak',
3279 '12' => 'Selangor',
3280 '13' => 'Terengganu',
3281 '14' => 'Kuala Lumpur',
3282 '15' => 'Labuan',
3283 '16' => 'Sabah',
3284 '17' => 'Putrajaya'
3285 },
3286 'MZ' => {
3287 '01' => 'Cabo Delgado',
3288 '02' => 'Gaza',
3289 '03' => 'Inhambane',
3290 '04' => 'Maputo',
3291 '05' => 'Sofala',
3292 '06' => 'Nampula',
3293 '07' => 'Niassa',
3294 '08' => 'Tete',
3295 '09' => 'Zambezia',
3296 '10' => 'Manica',
3297 '11' => 'Maputo'
3298 },
3299 'NA' => {
3300 '01' => 'Bethanien',
3301 '02' => 'Caprivi Oos',
3302 '03' => 'Boesmanland',
3303 '04' => 'Gobabis',
3304 '05' => 'Grootfontein',
3305 '06' => 'Kaokoland',
3306 '07' => 'Karibib',
3307 '08' => 'Keetmanshoop',
3308 '09' => 'Luderitz',
3309 '10' => 'Maltahohe',
3310 '11' => 'Okahandja',
3311 '12' => 'Omaruru',
3312 '13' => 'Otjiwarongo',
3313 '14' => 'Outjo',
3314 '15' => 'Owambo',
3315 '16' => 'Rehoboth',
3316 '17' => 'Swakopmund',
3317 '18' => 'Tsumeb',
3318 '20' => 'Karasburg',
3319 '21' => 'Windhoek',
3320 '22' => 'Damaraland',
3321 '23' => 'Hereroland Oos',
3322 '24' => 'Hereroland Wes',
3323 '25' => 'Kavango',
3324 '26' => 'Mariental',
3325 '27' => 'Namaland',
3326 '28' => 'Caprivi',
3327 '29' => 'Erongo',
3328 '30' => 'Hardap',
3329 '31' => 'Karas',
3330 '32' => 'Kunene',
3331 '33' => 'Ohangwena',
3332 '34' => 'Okavango',
3333 '35' => 'Omaheke',
3334 '36' => 'Omusati',
3335 '37' => 'Oshana',
3336 '38' => 'Oshikoto',
3337 '39' => 'Otjozondjupa'
3338 },
3339 'NE' => {
3340 '01' => 'Agadez',
3341 '02' => 'Diffa',
3342 '03' => 'Dosso',
3343 '04' => 'Maradi',
3344 '05' => 'Niamey',
3345 '06' => 'Tahoua',
3346 '07' => 'Zinder',
3347 '08' => 'Niamey'
3348 },
3349 'NG' => {
3350 '05' => 'Lagos',
3351 '11' => 'Federal Capital Territory',
3352 '16' => 'Ogun',
3353 '21' => 'Akwa Ibom',
3354 '22' => 'Cross River',
3355 '23' => 'Kaduna',
3356 '24' => 'Katsina',
3357 '25' => 'Anambra',
3358 '26' => 'Benue',
3359 '27' => 'Borno',
3360 '28' => 'Imo',
3361 '29' => 'Kano',
3362 '30' => 'Kwara',
3363 '31' => 'Niger',
3364 '32' => 'Oyo',
3365 '35' => 'Adamawa',
3366 '36' => 'Delta',
3367 '37' => 'Edo',
3368 '39' => 'Jigawa',
3369 '40' => 'Kebbi',
3370 '41' => 'Kogi',
3371 '42' => 'Osun',
3372 '43' => 'Taraba',
3373 '44' => 'Yobe',
3374 '45' => 'Abia',
3375 '46' => 'Bauchi',
3376 '47' => 'Enugu',
3377 '48' => 'Ondo',
3378 '49' => 'Plateau',
3379 '50' => 'Rivers',
3380 '51' => 'Sokoto',
3381 '52' => 'Bayelsa',
3382 '53' => 'Ebonyi',
3383 '54' => 'Ekiti',
3384 '55' => 'Gombe',
3385 '56' => 'Nassarawa',
3386 '57' => 'Zamfara'
3387 },
3388 'NI' => {
3389 '01' => 'Boaco',
3390 '02' => 'Carazo',
3391 '03' => 'Chinandega',
3392 '04' => 'Chontales',
3393 '05' => 'Esteli',
3394 '06' => 'Granada',
3395 '07' => 'Jinotega',
3396 '08' => 'Leon',
3397 '09' => 'Madriz',
3398 '10' => 'Managua',
3399 '11' => 'Masaya',
3400 '12' => 'Matagalpa',
3401 '13' => 'Nueva Segovia',
3402 '14' => 'Rio San Juan',
3403 '15' => 'Rivas',
3404 '16' => 'Zelaya',
3405 '17' => 'Autonoma Atlantico Norte',
3406 '18' => 'Region Autonoma Atlantico Sur'
3407 },
3408 'NL' => {
3409 '01' => 'Drenthe',
3410 '02' => 'Friesland',
3411 '03' => 'Gelderland',
3412 '04' => 'Groningen',
3413 '05' => 'Limburg',
3414 '06' => 'Noord-Brabant',
3415 '07' => 'Noord-Holland',
3416 '09' => 'Utrecht',
3417 '10' => 'Zeeland',
3418 '11' => 'Zuid-Holland',
3419 '15' => 'Overijssel',
3420 '16' => 'Flevoland'
3421 },
3422 'NO' => {
3423 '01' => 'Akershus',
3424 '02' => 'Aust-Agder',
3425 '04' => 'Buskerud',
3426 '05' => 'Finnmark',
3427 '06' => 'Hedmark',
3428 '07' => 'Hordaland',
3429 '08' => 'More og Romsdal',
3430 '09' => 'Nordland',
3431 '10' => 'Nord-Trondelag',
3432 '11' => 'Oppland',
3433 '12' => 'Oslo',
3434 '13' => 'Ostfold',
3435 '14' => 'Rogaland',
3436 '15' => 'Sogn og Fjordane',
3437 '16' => 'Sor-Trondelag',
3438 '17' => 'Telemark',
3439 '18' => 'Troms',
3440 '19' => 'Vest-Agder',
3441 '20' => 'Vestfold'
3442 },
3443 'NP' => {
3444 '01' => 'Bagmati',
3445 '02' => 'Bheri',
3446 '03' => 'Dhawalagiri',
3447 '04' => 'Gandaki',
3448 '05' => 'Janakpur',
3449 '06' => 'Karnali',
3450 '07' => 'Kosi',
3451 '08' => 'Lumbini',
3452 '09' => 'Mahakali',
3453 '10' => 'Mechi',
3454 '11' => 'Narayani',
3455 '12' => 'Rapti',
3456 '13' => 'Sagarmatha',
3457 '14' => 'Seti'
3458 },
3459 'NR' => {
3460 '01' => 'Aiwo',
3461 '02' => 'Anabar',
3462 '03' => 'Anetan',
3463 '04' => 'Anibare',
3464 '05' => 'Baiti',
3465 '06' => 'Boe',
3466 '07' => 'Buada',
3467 '08' => 'Denigomodu',
3468 '09' => 'Ewa',
3469 '10' => 'Ijuw',
3470 '11' => 'Meneng',
3471 '12' => 'Nibok',
3472 '13' => 'Uaboe',
3473 '14' => 'Yaren'
3474 },
3475 'NZ' => {
3476 '10' => 'Chatham Islands',
3477 'E7' => 'Auckland',
3478 'E8' => 'Bay of Plenty',
3479 'E9' => 'Canterbury',
3480 'F1' => 'Gisborne',
3481 'F2' => 'Hawke\'s Bay',
3482 'F3' => 'Manawatu-Wanganui',
3483 'F4' => 'Marlborough',
3484 'F5' => 'Nelson',
3485 'F6' => 'Northland',
3486 'F7' => 'Otago',
3487 'F8' => 'Southland',
3488 'F9' => 'Taranaki',
3489 'G1' => 'Waikato',
3490 'G2' => 'Wellington',
3491 'G3' => 'West Coast'
3492 },
3493 'OM' => {
3494 '01' => 'Ad Dakhiliyah',
3495 '02' => 'Al Batinah',
3496 '03' => 'Al Wusta',
3497 '04' => 'Ash Sharqiyah',
3498 '05' => 'Az Zahirah',
3499 '06' => 'Masqat',
3500 '07' => 'Musandam',
3501 '08' => 'Zufar'
3502 },
3503 'PA' => {
3504 '01' => 'Bocas del Toro',
3505 '02' => 'Chiriqui',
3506 '03' => 'Cocle',
3507 '04' => 'Colon',
3508 '05' => 'Darien',
3509 '06' => 'Herrera',
3510 '07' => 'Los Santos',
3511 '08' => 'Panama',
3512 '09' => 'San Blas',
3513 '10' => 'Veraguas'
3514 },
3515 'PE' => {
3516 '01' => 'Amazonas',
3517 '02' => 'Ancash',
3518 '03' => 'Apurimac',
3519 '04' => 'Arequipa',
3520 '05' => 'Ayacucho',
3521 '06' => 'Cajamarca',
3522 '07' => 'Callao',
3523 '08' => 'Cusco',
3524 '09' => 'Huancavelica',
3525 '10' => 'Huanuco',
3526 '11' => 'Ica',
3527 '12' => 'Junin',
3528 '13' => 'La Libertad',
3529 '14' => 'Lambayeque',
3530 '15' => 'Lima',
3531 '16' => 'Loreto',
3532 '17' => 'Madre de Dios',
3533 '18' => 'Moquegua',
3534 '19' => 'Pasco',
3535 '20' => 'Piura',
3536 '21' => 'Puno',
3537 '22' => 'San Martin',
3538 '23' => 'Tacna',
3539 '24' => 'Tumbes',
3540 '25' => 'Ucayali'
3541 },
3542 'PG' => {
3543 '01' => 'Central',
3544 '02' => 'Gulf',
3545 '03' => 'Milne Bay',
3546 '04' => 'Northern',
3547 '05' => 'Southern Highlands',
3548 '06' => 'Western',
3549 '07' => 'North Solomons',
3550 '08' => 'Chimbu',
3551 '09' => 'Eastern Highlands',
3552 '10' => 'East New Britain',
3553 '11' => 'East Sepik',
3554 '12' => 'Madang',
3555 '13' => 'Manus',
3556 '14' => 'Morobe',
3557 '15' => 'New Ireland',
3558 '16' => 'Western Highlands',
3559 '17' => 'West New Britain',
3560 '18' => 'Sandaun',
3561 '19' => 'Enga',
3562 '20' => 'National Capital'
3563 },
3564 'PH' => {
3565 '01' => 'Abra',
3566 '02' => 'Agusan del Norte',
3567 '03' => 'Agusan del Sur',
3568 '04' => 'Aklan',
3569 '05' => 'Albay',
3570 '06' => 'Antique',
3571 '07' => 'Bataan',
3572 '08' => 'Batanes',
3573 '09' => 'Batangas',
3574 '10' => 'Benguet',
3575 '11' => 'Bohol',
3576 '12' => 'Bukidnon',
3577 '13' => 'Bulacan',
3578 '14' => 'Cagayan',
3579 '15' => 'Camarines Norte',
3580 '16' => 'Camarines Sur',
3581 '17' => 'Camiguin',
3582 '18' => 'Capiz',
3583 '19' => 'Catanduanes',
3584 '20' => 'Cavite',
3585 '21' => 'Cebu',
3586 '22' => 'Basilan',
3587 '23' => 'Eastern Samar',
3588 '24' => 'Davao',
3589 '25' => 'Davao del Sur',
3590 '26' => 'Davao Oriental',
3591 '27' => 'Ifugao',
3592 '28' => 'Ilocos Norte',
3593 '29' => 'Ilocos Sur',
3594 '30' => 'Iloilo',
3595 '31' => 'Isabela',
3596 '32' => 'Kalinga-Apayao',
3597 '33' => 'Laguna',
3598 '34' => 'Lanao del Norte',
3599 '35' => 'Lanao del Sur',
3600 '36' => 'La Union',
3601 '37' => 'Leyte',
3602 '38' => 'Marinduque',
3603 '39' => 'Masbate',
3604 '40' => 'Mindoro Occidental',
3605 '41' => 'Mindoro Oriental',
3606 '42' => 'Misamis Occidental',
3607 '43' => 'Misamis Oriental',
3608 '44' => 'Mountain',
3609 '45' => 'Negros Occidental',
3610 '46' => 'Negros Oriental',
3611 '47' => 'Nueva Ecija',
3612 '48' => 'Nueva Vizcaya',
3613 '49' => 'Palawan',
3614 '50' => 'Pampanga',
3615 '51' => 'Pangasinan',
3616 '53' => 'Rizal',
3617 '54' => 'Romblon',
3618 '55' => 'Samar',
3619 '56' => 'Maguindanao',
3620 '57' => 'North Cotabato',
3621 '58' => 'Sorsogon',
3622 '59' => 'Southern Leyte',
3623 '60' => 'Sulu',
3624 '61' => 'Surigao del Norte',
3625 '62' => 'Surigao del Sur',
3626 '63' => 'Tarlac',
3627 '64' => 'Zambales',
3628 '65' => 'Zamboanga del Norte',
3629 '66' => 'Zamboanga del Sur',
3630 '67' => 'Northern Samar',
3631 '68' => 'Quirino',
3632 '69' => 'Siquijor',
3633 '70' => 'South Cotabato',
3634 '71' => 'Sultan Kudarat',
3635 '72' => 'Tawitawi',
3636 'A1' => 'Angeles',
3637 'A2' => 'Bacolod',
3638 'A3' => 'Bago',
3639 'A4' => 'Baguio',
3640 'A5' => 'Bais',
3641 'A6' => 'Basilan City',
3642 'A7' => 'Batangas City',
3643 'A8' => 'Butuan',
3644 'A9' => 'Cabanatuan',
3645 'B1' => 'Cadiz',
3646 'B2' => 'Cagayan de Oro',
3647 'B3' => 'Calbayog',
3648 'B4' => 'Caloocan',
3649 'B5' => 'Canlaon',
3650 'B6' => 'Cavite City',
3651 'B7' => 'Cebu City',
3652 'B8' => 'Cotabato',
3653 'B9' => 'Dagupan',
3654 'C1' => 'Danao',
3655 'C2' => 'Dapitan',
3656 'C3' => 'Davao City',
3657 'C4' => 'Dipolog',
3658 'C5' => 'Dumaguete',
3659 'C6' => 'General Santos',
3660 'C7' => 'Gingoog',
3661 'C8' => 'Iligan',
3662 'C9' => 'Iloilo City',
3663 'D1' => 'Iriga',
3664 'D2' => 'La Carlota',
3665 'D3' => 'Laoag',
3666 'D4' => 'Lapu-Lapu',
3667 'D5' => 'Legaspi',
3668 'D6' => 'Lipa',
3669 'D7' => 'Lucena',
3670 'D8' => 'Mandaue',
3671 'D9' => 'Manila',
3672 'E1' => 'Marawi',
3673 'E2' => 'Naga',
3674 'E3' => 'Olongapo',
3675 'E4' => 'Ormoc',
3676 'E5' => 'Oroquieta',
3677 'E6' => 'Ozamis',
3678 'E7' => 'Pagadian',
3679 'E8' => 'Palayan',
3680 'E9' => 'Pasay',
3681 'F1' => 'Puerto Princesa',
3682 'F2' => 'Quezon City',
3683 'F3' => 'Roxas',
3684 'F4' => 'San Carlos',
3685 'F5' => 'San Carlos',
3686 'F6' => 'San Jose',
3687 'F7' => 'San Pablo',
3688 'F8' => 'Silay',
3689 'F9' => 'Surigao',
3690 'G1' => 'Tacloban',
3691 'G2' => 'Tagaytay',
3692 'G3' => 'Tagbilaran',
3693 'G4' => 'Tangub',
3694 'G5' => 'Toledo',
3695 'G6' => 'Trece Martires',
3696 'G7' => 'Zamboanga',
3697 'G8' => 'Aurora',
3698 'H2' => 'Quezon',
3699 'H3' => 'Negros Occidental',
3700 'H9' => 'Biliran',
3701 'I6' => 'Compostela Valley',
3702 'I7' => 'Davao del Norte',
3703 'J3' => 'Guimaras',
3704 'J4' => 'Himamaylan',
3705 'J7' => 'Kalinga',
3706 'K1' => 'Las Pinas',
3707 'K5' => 'Malabon',
3708 'K6' => 'Malaybalay',
3709 'L4' => 'Muntinlupa',
3710 'L5' => 'Navotas',
3711 'L7' => 'Paranaque',
3712 'L9' => 'Passi',
3713 'M5' => 'San Jose del Monte',
3714 'M6' => 'San Juan',
3715 'M8' => 'Santiago',
3716 'M9' => 'Sarangani',
3717 'N1' => 'Sipalay',
3718 'N3' => 'Surigao del Norte',
3719 'P1' => 'Zambales',
3720 'P2' => 'Zamboanga'
3721 },
3722 'PK' => {
3723 '01' => 'Federally Administered Tribal Areas',
3724 '02' => 'Balochistan',
3725 '03' => 'North-West Frontier',
3726 '04' => 'Punjab',
3727 '05' => 'Sindh',
3728 '06' => 'Azad Kashmir',
3729 '07' => 'Northern Areas',
3730 '08' => 'Islamabad'
3731 },
3732 'PL' => {
3733 '72' => 'Dolnoslaskie',
3734 '73' => 'Kujawsko-Pomorskie',
3735 '74' => 'Lodzkie',
3736 '75' => 'Lubelskie',
3737 '76' => 'Lubuskie',
3738 '77' => 'Malopolskie',
3739 '78' => 'Mazowieckie',
3740 '79' => 'Opolskie',
3741 '80' => 'Podkarpackie',
3742 '81' => 'Podlaskie',
3743 '82' => 'Pomorskie',
3744 '83' => 'Slaskie',
3745 '84' => 'Swietokrzyskie',
3746 '85' => 'Warminsko-Mazurskie',
3747 '86' => 'Wielkopolskie',
3748 '87' => 'Zachodniopomorskie'
3749 },
3750 'PS' => {
3751 'GZ' => 'Gaza',
3752 'WE' => 'West Bank'
3753 },
3754 'PT' => {
3755 '02' => 'Aveiro',
3756 '03' => 'Beja',
3757 '04' => 'Braga',
3758 '05' => 'Braganca',
3759 '06' => 'Castelo Branco',
3760 '07' => 'Coimbra',
3761 '08' => 'Evora',
3762 '09' => 'Faro',
3763 '10' => 'Madeira',
3764 '11' => 'Guarda',
3765 '13' => 'Leiria',
3766 '14' => 'Lisboa',
3767 '16' => 'Portalegre',
3768 '17' => 'Porto',
3769 '18' => 'Santarem',
3770 '19' => 'Setubal',
3771 '20' => 'Viana do Castelo',
3772 '21' => 'Vila Real',
3773 '22' => 'Viseu',
3774 '23' => 'Azores'
3775 },
3776 'PY' => {
3777 '01' => 'Alto Parana',
3778 '02' => 'Amambay',
3779 '04' => 'Caaguazu',
3780 '05' => 'Caazapa',
3781 '06' => 'Central',
3782 '07' => 'Concepcion',
3783 '08' => 'Cordillera',
3784 '10' => 'Guaira',
3785 '11' => 'Itapua',
3786 '12' => 'Misiones',
3787 '13' => 'Neembucu',
3788 '15' => 'Paraguari',
3789 '16' => 'Presidente Hayes',
3790 '17' => 'San Pedro',
3791 '19' => 'Canindeyu',
3792 '22' => 'Asuncion',
3793 '23' => 'Alto Paraguay',
3794 '24' => 'Boqueron'
3795 },
3796 'QA' => {
3797 '01' => 'Ad Dawhah',
3798 '02' => 'Al Ghuwariyah',
3799 '03' => 'Al Jumaliyah',
3800 '04' => 'Al Khawr',
3801 '05' => 'Al Wakrah Municipality',
3802 '06' => 'Ar Rayyan',
3803 '08' => 'Madinat ach Shamal',
3804 '09' => 'Umm Salal',
3805 '10' => 'Al Wakrah',
3806 '11' => 'Jariyan al Batnah',
3807 '12' => 'Umm Sa\'id'
3808 },
3809 'RO' => {
3810 '01' => 'Alba',
3811 '02' => 'Arad',
3812 '03' => 'Arges',
3813 '04' => 'Bacau',
3814 '05' => 'Bihor',
3815 '06' => 'Bistrita-Nasaud',
3816 '07' => 'Botosani',
3817 '08' => 'Braila',
3818 '09' => 'Brasov',
3819 '10' => 'Bucuresti',
3820 '11' => 'Buzau',
3821 '12' => 'Caras-Severin',
3822 '13' => 'Cluj',
3823 '14' => 'Constanta',
3824 '15' => 'Covasna',
3825 '16' => 'Dambovita',
3826 '17' => 'Dolj',
3827 '18' => 'Galati',
3828 '19' => 'Gorj',
3829 '20' => 'Harghita',
3830 '21' => 'Hunedoara',
3831 '22' => 'Ialomita',
3832 '23' => 'Iasi',
3833 '25' => 'Maramures',
3834 '26' => 'Mehedinti',
3835 '27' => 'Mures',
3836 '28' => 'Neamt',
3837 '29' => 'Olt',
3838 '30' => 'Prahova',
3839 '31' => 'Salaj',
3840 '32' => 'Satu Mare',
3841 '33' => 'Sibiu',
3842 '34' => 'Suceava',
3843 '35' => 'Teleorman',
3844 '36' => 'Timis',
3845 '37' => 'Tulcea',
3846 '38' => 'Vaslui',
3847 '39' => 'Valcea',
3848 '40' => 'Vrancea',
3849 '41' => 'Calarasi',
3850 '42' => 'Giurgiu',
3851 '43' => 'Ilfov'
3852 },
3853 'RS' => {
3854 '01' => 'Kosovo',
3855 '02' => 'Vojvodina'
3856 },
3857 'RU' => {
3858 '01' => 'Adygeya, Republic of',
3859 '02' => 'Aginsky Buryatsky AO',
3860 '03' => 'Gorno-Altay',
3861 '04' => 'Altaisky krai',
3862 '05' => 'Amur',
3863 '06' => 'Arkhangel\'sk',
3864 '07' => 'Astrakhan\'',
3865 '08' => 'Bashkortostan',
3866 '09' => 'Belgorod',
3867 '10' => 'Bryansk',
3868 '11' => 'Buryat',
3869 '12' => 'Chechnya',
3870 '13' => 'Chelyabinsk',
3871 '14' => 'Chita',
3872 '15' => 'Chukot',
3873 '16' => 'Chuvashia',
3874 '17' => 'Dagestan',
3875 '18' => 'Evenk',
3876 '19' => 'Ingush',
3877 '20' => 'Irkutsk',
3878 '21' => 'Ivanovo',
3879 '22' => 'Kabardin-Balkar',
3880 '23' => 'Kaliningrad',
3881 '24' => 'Kalmyk',
3882 '25' => 'Kaluga',
3883 '26' => 'Kamchatka',
3884 '27' => 'Karachay-Cherkess',
3885 '28' => 'Karelia',
3886 '29' => 'Kemerovo',
3887 '30' => 'Khabarovsk',
3888 '31' => 'Khakass',
3889 '32' => 'Khanty-Mansiy',
3890 '33' => 'Kirov',
3891 '34' => 'Komi',
3892 '36' => 'Koryak',
3893 '37' => 'Kostroma',
3894 '38' => 'Krasnodar',
3895 '39' => 'Krasnoyarsk',
3896 '40' => 'Kurgan',
3897 '41' => 'Kursk',
3898 '42' => 'Leningrad',
3899 '43' => 'Lipetsk',
3900 '44' => 'Magadan',
3901 '45' => 'Mariy-El',
3902 '46' => 'Mordovia',
3903 '47' => 'Moskva',
3904 '48' => 'Moscow City',
3905 '49' => 'Murmansk',
3906 '50' => 'Nenets',
3907 '51' => 'Nizhegorod',
3908 '52' => 'Novgorod',
3909 '53' => 'Novosibirsk',
3910 '54' => 'Omsk',
3911 '55' => 'Orenburg',
3912 '56' => 'Orel',
3913 '57' => 'Penza',
3914 '58' => 'Perm\'',
3915 '59' => 'Primor\'ye',
3916 '60' => 'Pskov',
3917 '61' => 'Rostov',
3918 '62' => 'Ryazan\'',
3919 '63' => 'Sakha',
3920 '64' => 'Sakhalin',
3921 '65' => 'Samara',
3922 '66' => 'Saint Petersburg City',
3923 '67' => 'Saratov',
3924 '68' => 'North Ossetia',
3925 '69' => 'Smolensk',
3926 '70' => 'Stavropol\'',
3927 '71' => 'Sverdlovsk',
3928 '72' => 'Tambovskaya oblast',
3929 '73' => 'Tatarstan',
3930 '74' => 'Taymyr',
3931 '75' => 'Tomsk',
3932 '76' => 'Tula',
3933 '77' => 'Tver\'',
3934 '78' => 'Tyumen\'',
3935 '79' => 'Tuva',
3936 '80' => 'Udmurt',
3937 '81' => 'Ul\'yanovsk',
3938 '83' => 'Vladimir',
3939 '84' => 'Volgograd',
3940 '85' => 'Vologda',
3941 '86' => 'Voronezh',
3942 '87' => 'Yamal-Nenets',
3943 '88' => 'Yaroslavl\'',
3944 '89' => 'Yevrey',
3945 '90' => 'Permskiy Kray',
3946 '91' => 'Krasnoyarskiy Kray',
3947 '92' => 'Kamchatskiy Kray',
3948 '93' => 'Zabaykal\'skiy Kray'
3949 },
3950 'RW' => {
3951 '01' => 'Butare',
3952 '06' => 'Gitarama',
3953 '07' => 'Kibungo',
3954 '09' => 'Kigali',
3955 '11' => 'Est',
3956 '12' => 'Kigali',
3957 '13' => 'Nord',
3958 '14' => 'Ouest',
3959 '15' => 'Sud'
3960 },
3961 'SA' => {
3962 '02' => 'Al Bahah',
3963 '05' => 'Al Madinah',
3964 '06' => 'Ash Sharqiyah',
3965 '08' => 'Al Qasim',
3966 '10' => 'Ar Riyad',
3967 '11' => 'Asir Province',
3968 '13' => 'Ha\'il',
3969 '14' => 'Makkah',
3970 '15' => 'Al Hudud ash Shamaliyah',
3971 '16' => 'Najran',
3972 '17' => 'Jizan',
3973 '19' => 'Tabuk',
3974 '20' => 'Al Jawf'
3975 },
3976 'SB' => {
3977 '03' => 'Malaita',
3978 '06' => 'Guadalcanal',
3979 '07' => 'Isabel',
3980 '08' => 'Makira',
3981 '09' => 'Temotu',
3982 '10' => 'Central',
3983 '11' => 'Western',
3984 '12' => 'Choiseul',
3985 '13' => 'Rennell and Bellona'
3986 },
3987 'SC' => {
3988 '01' => 'Anse aux Pins',
3989 '02' => 'Anse Boileau',
3990 '03' => 'Anse Etoile',
3991 '04' => 'Anse Louis',
3992 '05' => 'Anse Royale',
3993 '06' => 'Baie Lazare',
3994 '07' => 'Baie Sainte Anne',
3995 '08' => 'Beau Vallon',
3996 '09' => 'Bel Air',
3997 '10' => 'Bel Ombre',
3998 '11' => 'Cascade',
3999 '12' => 'Glacis',
4000 '13' => 'Grand\' Anse',
4001 '14' => 'Grand\' Anse',
4002 '15' => 'La Digue',
4003 '16' => 'La Riviere Anglaise',
4004 '17' => 'Mont Buxton',
4005 '18' => 'Mont Fleuri',
4006 '19' => 'Plaisance',
4007 '20' => 'Pointe La Rue',
4008 '21' => 'Port Glaud',
4009 '22' => 'Saint Louis',
4010 '23' => 'Takamaka'
4011 },
4012 'SD' => {
4013 '27' => 'Al Wusta',
4014 '28' => 'Al Istiwa\'iyah',
4015 '29' => 'Al Khartum',
4016 '30' => 'Ash Shamaliyah',
4017 '31' => 'Ash Sharqiyah',
4018 '32' => 'Bahr al Ghazal',
4019 '33' => 'Darfur',
4020 '34' => 'Kurdufan',
4021 '35' => 'Upper Nile',
4022 '40' => 'Al Wahadah State',
4023 '44' => 'Central Equatoria State',
4024 '49' => 'Southern Darfur',
4025 '50' => 'Southern Kordofan',
4026 '52' => 'Kassala',
4027 '53' => 'River Nile',
4028 '55' => 'Northern Darfur'
4029 },
4030 'SE' => {
4031 '02' => 'Blekinge Lan',
4032 '03' => 'Gavleborgs Lan',
4033 '05' => 'Gotlands Lan',
4034 '06' => 'Hallands Lan',
4035 '07' => 'Jamtlands Lan',
4036 '08' => 'Jonkopings Lan',
4037 '09' => 'Kalmar Lan',
4038 '10' => 'Dalarnas Lan',
4039 '12' => 'Kronobergs Lan',
4040 '14' => 'Norrbottens Lan',
4041 '15' => 'Orebro Lan',
4042 '16' => 'Ostergotlands Lan',
4043 '18' => 'Sodermanlands Lan',
4044 '21' => 'Uppsala Lan',
4045 '22' => 'Varmlands Lan',
4046 '23' => 'Vasterbottens Lan',
4047 '24' => 'Vasternorrlands Lan',
4048 '25' => 'Vastmanlands Lan',
4049 '26' => 'Stockholms Lan',
4050 '27' => 'Skane Lan',
4051 '28' => 'Vastra Gotaland'
4052 },
4053 'SH' => {
4054 '01' => 'Ascension',
4055 '02' => 'Saint Helena',
4056 '03' => 'Tristan da Cunha'
4057 },
4058 'SI' => {
4059 '01' => 'Ajdovscina Commune',
4060 '02' => 'Beltinci Commune',
4061 '03' => 'Bled Commune',
4062 '04' => 'Bohinj Commune',
4063 '05' => 'Borovnica Commune',
4064 '06' => 'Bovec Commune',
4065 '07' => 'Brda Commune',
4066 '08' => 'Brezice Commune',
4067 '09' => 'Brezovica Commune',
4068 '11' => 'Celje Commune',
4069 '12' => 'Cerklje na Gorenjskem Commune',
4070 '13' => 'Cerknica Commune',
4071 '14' => 'Cerkno Commune',
4072 '15' => 'Crensovci Commune',
4073 '16' => 'Crna na Koroskem Commune',
4074 '17' => 'Crnomelj Commune',
4075 '19' => 'Divaca Commune',
4076 '20' => 'Dobrepolje Commune',
4077 '22' => 'Dol pri Ljubljani Commune',
4078 '24' => 'Dornava Commune',
4079 '25' => 'Dravograd Commune',
4080 '26' => 'Duplek Commune',
4081 '27' => 'Gorenja vas-Poljane Commune',
4082 '28' => 'Gorisnica Commune',
4083 '29' => 'Gornja Radgona Commune',
4084 '30' => 'Gornji Grad Commune',
4085 '31' => 'Gornji Petrovci Commune',
4086 '32' => 'Grosuplje Commune',
4087 '34' => 'Hrastnik Commune',
4088 '35' => 'Hrpelje-Kozina Commune',
4089 '36' => 'Idrija Commune',
4090 '37' => 'Ig Commune',
4091 '38' => 'Ilirska Bistrica Commune',
4092 '39' => 'Ivancna Gorica Commune',
4093 '40' => 'Izola-Isola Commune',
4094 '42' => 'Jursinci Commune',
4095 '44' => 'Kanal Commune',
4096 '45' => 'Kidricevo Commune',
4097 '46' => 'Kobarid Commune',
4098 '47' => 'Kobilje Commune',
4099 '49' => 'Komen Commune',
4100 '50' => 'Koper-Capodistria Urban Commune',
4101 '51' => 'Kozje Commune',
4102 '52' => 'Kranj Commune',
4103 '53' => 'Kranjska Gora Commune',
4104 '54' => 'Krsko Commune',
4105 '55' => 'Kungota Commune',
4106 '57' => 'Lasko Commune',
4107 '61' => 'Ljubljana Urban Commune',
4108 '62' => 'Ljubno Commune',
4109 '64' => 'Logatec Commune',
4110 '66' => 'Loski Potok Commune',
4111 '68' => 'Lukovica Commune',
4112 '71' => 'Medvode Commune',
4113 '72' => 'Menges Commune',
4114 '73' => 'Metlika Commune',
4115 '74' => 'Mezica Commune',
4116 '76' => 'Mislinja Commune',
4117 '77' => 'Moravce Commune',
4118 '78' => 'Moravske Toplice Commune',
4119 '79' => 'Mozirje Commune',
4120 '80' => 'Murska Sobota Urban Commune',
4121 '81' => 'Muta Commune',
4122 '82' => 'Naklo Commune',
4123 '83' => 'Nazarje Commune',
4124 '84' => 'Nova Gorica Urban Commune',
4125 '86' => 'Odranci Commune',
4126 '87' => 'Ormoz Commune',
4127 '88' => 'Osilnica Commune',
4128 '89' => 'Pesnica Commune',
4129 '91' => 'Pivka Commune',
4130 '92' => 'Podcetrtek Commune',
4131 '94' => 'Postojna Commune',
4132 '97' => 'Puconci Commune',
4133 '98' => 'Race-Fram Commune',
4134 '99' => 'Radece Commune',
4135 'A1' => 'Radenci Commune',
4136 'A2' => 'Radlje ob Dravi Commune',
4137 'A3' => 'Radovljica Commune',
4138 'A6' => 'Rogasovci Commune',
4139 'A7' => 'Rogaska Slatina Commune',
4140 'A8' => 'Rogatec Commune',
4141 'B1' => 'Semic Commune',
4142 'B2' => 'Sencur Commune',
4143 'B3' => 'Sentilj Commune',
4144 'B4' => 'Sentjernej Commune',
4145 'B6' => 'Sevnica Commune',
4146 'B7' => 'Sezana Commune',
4147 'B8' => 'Skocjan Commune',
4148 'B9' => 'Skofja Loka Commune',
4149 'C1' => 'Skofljica Commune',
4150 'C2' => 'Slovenj Gradec Urban Commune',
4151 'C4' => 'Slovenske Konjice Commune',
4152 'C5' => 'Smarje pri Jelsah Commune',
4153 'C6' => 'Smartno ob Paki Commune',
4154 'C7' => 'Sostanj Commune',
4155 'C8' => 'Starse Commune',
4156 'C9' => 'Store Commune',
4157 'D1' => 'Sveti Jurij Commune',
4158 'D2' => 'Tolmin Commune',
4159 'D3' => 'Trbovlje Commune',
4160 'D4' => 'Trebnje Commune',
4161 'D5' => 'Trzic Commune',
4162 'D6' => 'Turnisce Commune',
4163 'D7' => 'Velenje Urban Commune',
4164 'D8' => 'Velike Lasce Commune',
4165 'E1' => 'Vipava Commune',
4166 'E2' => 'Vitanje Commune',
4167 'E3' => 'Vodice Commune',
4168 'E5' => 'Vrhnika Commune',
4169 'E6' => 'Vuzenica Commune',
4170 'E7' => 'Zagorje ob Savi Commune',
4171 'E9' => 'Zavrc Commune',
4172 'F1' => 'Zelezniki Commune',
4173 'F2' => 'Ziri Commune',
4174 'F3' => 'Zrece Commune',
4175 'F4' => 'Benedikt Commune',
4176 'F5' => 'Bistrica ob Sotli Commune',
4177 'F6' => 'Bloke Commune',
4178 'F7' => 'Braslovce Commune',
4179 'F8' => 'Cankova Commune',
4180 'F9' => 'Cerkvenjak Commune',
4181 'G1' => 'Destrnik Commune',
4182 'G2' => 'Dobje Commune',
4183 'G3' => 'Dobrna Commune',
4184 'G4' => 'Dobrova-Horjul-Polhov Gradec Commune',
4185 'G5' => 'Dobrovnik-Dobronak Commune',
4186 'G6' => 'Dolenjske Toplice Commune',
4187 'G7' => 'Domzale Commune',
4188 'G8' => 'Grad Commune',
4189 'G9' => 'Hajdina Commune',
4190 'H1' => 'Hoce-Slivnica Commune',
4191 'H2' => 'Hodos-Hodos Commune',
4192 'H3' => 'Horjul Commune',
4193 'H4' => 'Jesenice Commune',
4194 'H5' => 'Jezersko Commune',
4195 'H6' => 'Kamnik Commune',
4196 'H7' => 'Kocevje Commune',
4197 'H8' => 'Komenda Commune',
4198 'H9' => 'Kostel Commune',
4199 'I1' => 'Krizevci Commune',
4200 'I2' => 'Kuzma Commune',
4201 'I3' => 'Lenart Commune',
4202 'I4' => 'Lendava-Lendva Commune',
4203 'I5' => 'Litija Commune',
4204 'I6' => 'Ljutomer Commune',
4205 'I7' => 'Loska Dolina Commune',
4206 'I8' => 'Lovrenc na Pohorju Commune',
4207 'I9' => 'Luce Commune',
4208 'J1' => 'Majsperk Commune',
4209 'J2' => 'Maribor Commune',
4210 'J3' => 'Markovci Commune',
4211 'J4' => 'Miklavz na Dravskem polju Commune',
4212 'J5' => 'Miren-Kostanjevica Commune',
4213 'J6' => 'Mirna Pec Commune',
4214 'J7' => 'Novo mesto Urban Commune',
4215 'J8' => 'Oplotnica Commune',
4216 'J9' => 'Piran-Pirano Commune',
4217 'K1' => 'Podlehnik Commune',
4218 'K2' => 'Podvelka Commune',
4219 'K3' => 'Polzela Commune',
4220 'K4' => 'Prebold Commune',
4221 'K5' => 'Preddvor Commune',
4222 'K6' => 'Prevalje Commune',
4223 'K7' => 'Ptuj Urban Commune',
4224 'K8' => 'Ravne na Koroskem Commune',
4225 'K9' => 'Razkrizje Commune',
4226 'L1' => 'Ribnica Commune',
4227 'L2' => 'Ribnica na Pohorju Commune',
4228 'L3' => 'Ruse Commune',
4229 'L4' => 'Salovci Commune',
4230 'L5' => 'Selnica ob Dravi Commune',
4231 'L6' => 'Sempeter-Vrtojba Commune',
4232 'L7' => 'Sentjur pri Celju Commune',
4233 'L8' => 'Slovenska Bistrica Commune',
4234 'L9' => 'Smartno pri Litiji Commune',
4235 'M1' => 'Sodrazica Commune',
4236 'M2' => 'Solcava Commune',
4237 'M3' => 'Sveta Ana Commune',
4238 'M4' => 'Sveti Andraz v Slovenskih goricah Commune',
4239 'M5' => 'Tabor Commune',
4240 'M6' => 'Tisina Commune',
4241 'M7' => 'Trnovska vas Commune',
4242 'M8' => 'Trzin Commune',
4243 'M9' => 'Velika Polana Commune',
4244 'N1' => 'Verzej Commune',
4245 'N2' => 'Videm Commune',
4246 'N3' => 'Vojnik Commune',
4247 'N4' => 'Vransko Commune',
4248 'N5' => 'Zalec Commune',
4249 'N6' => 'Zetale Commune',
4250 'N7' => 'Zirovnica Commune',
4251 'N8' => 'Zuzemberk Commune',
4252 'N9' => 'Apace Commune',
4253 'O1' => 'Cirkulane Commune',
4254 'O2' => 'Gorje',
4255 'O3' => 'Kostanjevica na Krki',
4256 'O4' => 'Log-Dragomer',
4257 'O5' => 'Makole',
4258 'O6' => 'Mirna',
4259 'O7' => 'Mokronog-Trebelno',
4260 'O8' => 'Poljcane',
4261 'O9' => 'Recica ob Savinji',
4262 'P1' => 'Rence-Vogrsko',
4263 'P2' => 'Sentrupert',
4264 'P3' => 'Smarjesk Toplice',
4265 'P4' => 'Sredisce ob Dravi',
4266 'P5' => 'Straza',
4267 'P7' => 'Sveti Jurij v Slovenskih Goricah'
4268 },
4269 'SK' => {
4270 '01' => 'Banska Bystrica',
4271 '02' => 'Bratislava',
4272 '03' => 'Kosice',
4273 '04' => 'Nitra',
4274 '05' => 'Presov',
4275 '06' => 'Trencin',
4276 '07' => 'Trnava',
4277 '08' => 'Zilina'
4278 },
4279 'SL' => {
4280 '01' => 'Eastern',
4281 '02' => 'Northern',
4282 '03' => 'Southern',
4283 '04' => 'Western Area'
4284 },
4285 'SM' => {
4286 '01' => 'Acquaviva',
4287 '02' => 'Chiesanuova',
4288 '03' => 'Domagnano',
4289 '04' => 'Faetano',
4290 '05' => 'Fiorentino',
4291 '06' => 'Borgo Maggiore',
4292 '07' => 'San Marino',
4293 '08' => 'Monte Giardino',
4294 '09' => 'Serravalle'
4295 },
4296 'SN' => {
4297 '01' => 'Dakar',
4298 '03' => 'Diourbel',
4299 '05' => 'Tambacounda',
4300 '07' => 'Thies',
4301 '09' => 'Fatick',
4302 '10' => 'Kaolack',
4303 '11' => 'Kolda',
4304 '12' => 'Ziguinchor',
4305 '13' => 'Louga',
4306 '14' => 'Saint-Louis',
4307 '15' => 'Matam'
4308 },
4309 'SO' => {
4310 '01' => 'Bakool',
4311 '02' => 'Banaadir',
4312 '03' => 'Bari',
4313 '04' => 'Bay',
4314 '05' => 'Galguduud',
4315 '06' => 'Gedo',
4316 '07' => 'Hiiraan',
4317 '08' => 'Jubbada Dhexe',
4318 '09' => 'Jubbada Hoose',
4319 '10' => 'Mudug',
4320 '11' => 'Nugaal',
4321 '12' => 'Sanaag',
4322 '13' => 'Shabeellaha Dhexe',
4323 '14' => 'Shabeellaha Hoose',
4324 '16' => 'Woqooyi Galbeed',
4325 '18' => 'Nugaal',
4326 '19' => 'Togdheer',
4327 '20' => 'Woqooyi Galbeed',
4328 '21' => 'Awdal',
4329 '22' => 'Sool'
4330 },
4331 'SR' => {
4332 '10' => 'Brokopondo',
4333 '11' => 'Commewijne',
4334 '12' => 'Coronie',
4335 '13' => 'Marowijne',
4336 '14' => 'Nickerie',
4337 '15' => 'Para',
4338 '16' => 'Paramaribo',
4339 '17' => 'Saramacca',
4340 '18' => 'Sipaliwini',
4341 '19' => 'Wanica'
4342 },
4343 'SS' => {
4344 '01' => 'Central Equatoria',
4345 '02' => 'Eastern Equatoria',
4346 '03' => 'Jonglei',
4347 '04' => 'Lakes',
4348 '05' => 'Northern Bahr el Ghazal',
4349 '06' => 'Unity',
4350 '07' => 'Upper Nile',
4351 '08' => 'Warrap',
4352 '09' => 'Western Bahr el Ghazal',
4353 '10' => 'Western Equatoria'
4354 },
4355 'ST' => {
4356 '01' => 'Principe',
4357 '02' => 'Sao Tome'
4358 },
4359 'SV' => {
4360 '01' => 'Ahuachapan',
4361 '02' => 'Cabanas',
4362 '03' => 'Chalatenango',
4363 '04' => 'Cuscatlan',
4364 '05' => 'La Libertad',
4365 '06' => 'La Paz',
4366 '07' => 'La Union',
4367 '08' => 'Morazan',
4368 '09' => 'San Miguel',
4369 '10' => 'San Salvador',
4370 '11' => 'Santa Ana',
4371 '12' => 'San Vicente',
4372 '13' => 'Sonsonate',
4373 '14' => 'Usulutan'
4374 },
4375 'SY' => {
4376 '01' => 'Al Hasakah',
4377 '02' => 'Al Ladhiqiyah',
4378 '03' => 'Al Qunaytirah',
4379 '04' => 'Ar Raqqah',
4380 '05' => 'As Suwayda\'',
4381 '06' => 'Dar',
4382 '07' => 'Dayr az Zawr',
4383 '08' => 'Rif Dimashq',
4384 '09' => 'Halab',
4385 '10' => 'Hamah',
4386 '11' => 'Hims',
4387 '12' => 'Idlib',
4388 '13' => 'Dimashq',
4389 '14' => 'Tartus'
4390 },
4391 'SZ' => {
4392 '01' => 'Hhohho',
4393 '02' => 'Lubombo',
4394 '03' => 'Manzini',
4395 '04' => 'Shiselweni',
4396 '05' => 'Praslin'
4397 },
4398 'TD' => {
4399 '01' => 'Batha',
4400 '02' => 'Biltine',
4401 '03' => 'Borkou-Ennedi-Tibesti',
4402 '04' => 'Chari-Baguirmi',
4403 '05' => 'Guera',
4404 '06' => 'Kanem',
4405 '07' => 'Lac',
4406 '08' => 'Logone Occidental',
4407 '09' => 'Logone Oriental',
4408 '10' => 'Mayo-Kebbi',
4409 '11' => 'Moyen-Chari',
4410 '12' => 'Ouaddai',
4411 '13' => 'Salamat',
4412 '14' => 'Tandjile'
4413 },
4414 'TG' => {
4415 '22' => 'Centrale',
4416 '23' => 'Kara',
4417 '24' => 'Maritime',
4418 '25' => 'Plateaux',
4419 '26' => 'Savanes'
4420 },
4421 'TH' => {
4422 '01' => 'Mae Hong Son',
4423 '02' => 'Chiang Mai',
4424 '03' => 'Chiang Rai',
4425 '04' => 'Nan',
4426 '05' => 'Lamphun',
4427 '06' => 'Lampang',
4428 '07' => 'Phrae',
4429 '08' => 'Tak',
4430 '09' => 'Sukhothai',
4431 '10' => 'Uttaradit',
4432 '11' => 'Kamphaeng Phet',
4433 '12' => 'Phitsanulok',
4434 '13' => 'Phichit',
4435 '14' => 'Phetchabun',
4436 '15' => 'Uthai Thani',
4437 '16' => 'Nakhon Sawan',
4438 '17' => 'Nong Khai',
4439 '18' => 'Loei',
4440 '20' => 'Sakon Nakhon',
4441 '21' => 'Nakhon Phanom',
4442 '22' => 'Khon Kaen',
4443 '23' => 'Kalasin',
4444 '24' => 'Maha Sarakham',
4445 '25' => 'Roi Et',
4446 '26' => 'Chaiyaphum',
4447 '27' => 'Nakhon Ratchasima',
4448 '28' => 'Buriram',
4449 '29' => 'Surin',
4450 '30' => 'Sisaket',
4451 '31' => 'Narathiwat',
4452 '32' => 'Chai Nat',
4453 '33' => 'Sing Buri',
4454 '34' => 'Lop Buri',
4455 '35' => 'Ang Thong',
4456 '36' => 'Phra Nakhon Si Ayutthaya',
4457 '37' => 'Saraburi',
4458 '38' => 'Nonthaburi',
4459 '39' => 'Pathum Thani',
4460 '40' => 'Krung Thep',
4461 '41' => 'Phayao',
4462 '42' => 'Samut Prakan',
4463 '43' => 'Nakhon Nayok',
4464 '44' => 'Chachoengsao',
4465 '45' => 'Prachin Buri',
4466 '46' => 'Chon Buri',
4467 '47' => 'Rayong',
4468 '48' => 'Chanthaburi',
4469 '49' => 'Trat',
4470 '50' => 'Kanchanaburi',
4471 '51' => 'Suphan Buri',
4472 '52' => 'Ratchaburi',
4473 '53' => 'Nakhon Pathom',
4474 '54' => 'Samut Songkhram',
4475 '55' => 'Samut Sakhon',
4476 '56' => 'Phetchaburi',
4477 '57' => 'Prachuap Khiri Khan',
4478 '58' => 'Chumphon',
4479 '59' => 'Ranong',
4480 '60' => 'Surat Thani',
4481 '61' => 'Phangnga',
4482 '62' => 'Phuket',
4483 '63' => 'Krabi',
4484 '64' => 'Nakhon Si Thammarat',
4485 '65' => 'Trang',
4486 '66' => 'Phatthalung',
4487 '67' => 'Satun',
4488 '68' => 'Songkhla',
4489 '69' => 'Pattani',
4490 '70' => 'Yala',
4491 '71' => 'Ubon Ratchathani',
4492 '72' => 'Yasothon',
4493 '73' => 'Nakhon Phanom',
4494 '74' => 'Prachin Buri',
4495 '75' => 'Ubon Ratchathani',
4496 '76' => 'Udon Thani',
4497 '77' => 'Amnat Charoen',
4498 '78' => 'Mukdahan',
4499 '79' => 'Nong Bua Lamphu',
4500 '80' => 'Sa Kaeo',
4501 '81' => 'Bueng Kan'
4502 },
4503 'TJ' => {
4504 '01' => 'Kuhistoni Badakhshon',
4505 '02' => 'Khatlon',
4506 '03' => 'Sughd',
4507 '04' => 'Dushanbe',
4508 '05' => 'Nohiyahoi Tobei Jumhuri'
4509 },
4510 'TL' => { '06' => 'Dili' },
4511 'TM' => {
4512 '01' => 'Ahal',
4513 '02' => 'Balkan',
4514 '03' => 'Dashoguz',
4515 '04' => 'Lebap',
4516 '05' => 'Mary'
4517 },
4518 'TN' => {
4519 '02' => 'Kasserine',
4520 '03' => 'Kairouan',
4521 '06' => 'Jendouba',
4522 '10' => 'Qafsah',
4523 '14' => 'El Kef',
4524 '15' => 'Al Mahdia',
4525 '16' => 'Al Munastir',
4526 '17' => 'Bajah',
4527 '18' => 'Bizerte',
4528 '19' => 'Nabeul',
4529 '22' => 'Siliana',
4530 '23' => 'Sousse',
4531 '27' => 'Ben Arous',
4532 '28' => 'Madanin',
4533 '29' => 'Gabes',
4534 '31' => 'Kebili',
4535 '32' => 'Sfax',
4536 '33' => 'Sidi Bou Zid',
4537 '34' => 'Tataouine',
4538 '35' => 'Tozeur',
4539 '36' => 'Tunis',
4540 '37' => 'Zaghouan',
4541 '38' => 'Aiana',
4542 '39' => 'Manouba'
4543 },
4544 'TO' => {
4545 '01' => 'Ha',
4546 '02' => 'Tongatapu',
4547 '03' => 'Vava'
4548 },
4549 'TR' => {
4550 '02' => 'Adiyaman',
4551 '03' => 'Afyonkarahisar',
4552 '04' => 'Agri',
4553 '05' => 'Amasya',
4554 '07' => 'Antalya',
4555 '08' => 'Artvin',
4556 '09' => 'Aydin',
4557 '10' => 'Balikesir',
4558 '11' => 'Bilecik',
4559 '12' => 'Bingol',
4560 '13' => 'Bitlis',
4561 '14' => 'Bolu',
4562 '15' => 'Burdur',
4563 '16' => 'Bursa',
4564 '17' => 'Canakkale',
4565 '19' => 'Corum',
4566 '20' => 'Denizli',
4567 '21' => 'Diyarbakir',
4568 '22' => 'Edirne',
4569 '23' => 'Elazig',
4570 '24' => 'Erzincan',
4571 '25' => 'Erzurum',
4572 '26' => 'Eskisehir',
4573 '28' => 'Giresun',
4574 '31' => 'Hatay',
4575 '32' => 'Mersin',
4576 '33' => 'Isparta',
4577 '34' => 'Istanbul',
4578 '35' => 'Izmir',
4579 '37' => 'Kastamonu',
4580 '38' => 'Kayseri',
4581 '39' => 'Kirklareli',
4582 '40' => 'Kirsehir',
4583 '41' => 'Kocaeli',
4584 '43' => 'Kutahya',
4585 '44' => 'Malatya',
4586 '45' => 'Manisa',
4587 '46' => 'Kahramanmaras',
4588 '48' => 'Mugla',
4589 '49' => 'Mus',
4590 '50' => 'Nevsehir',
4591 '52' => 'Ordu',
4592 '53' => 'Rize',
4593 '54' => 'Sakarya',
4594 '55' => 'Samsun',
4595 '57' => 'Sinop',
4596 '58' => 'Sivas',
4597 '59' => 'Tekirdag',
4598 '60' => 'Tokat',
4599 '61' => 'Trabzon',
4600 '62' => 'Tunceli',
4601 '63' => 'Sanliurfa',
4602 '64' => 'Usak',
4603 '65' => 'Van',
4604 '66' => 'Yozgat',
4605 '68' => 'Ankara',
4606 '69' => 'Gumushane',
4607 '70' => 'Hakkari',
4608 '71' => 'Konya',
4609 '72' => 'Mardin',
4610 '73' => 'Nigde',
4611 '74' => 'Siirt',
4612 '75' => 'Aksaray',
4613 '76' => 'Batman',
4614 '77' => 'Bayburt',
4615 '78' => 'Karaman',
4616 '79' => 'Kirikkale',
4617 '80' => 'Sirnak',
4618 '81' => 'Adana',
4619 '82' => 'Cankiri',
4620 '83' => 'Gaziantep',
4621 '84' => 'Kars',
4622 '85' => 'Zonguldak',
4623 '86' => 'Ardahan',
4624 '87' => 'Bartin',
4625 '88' => 'Igdir',
4626 '89' => 'Karabuk',
4627 '90' => 'Kilis',
4628 '91' => 'Osmaniye',
4629 '92' => 'Yalova',
4630 '93' => 'Duzce'
4631 },
4632 'TT' => {
4633 '01' => 'Arima',
4634 '02' => 'Caroni',
4635 '03' => 'Mayaro',
4636 '04' => 'Nariva',
4637 '05' => 'Port-of-Spain',
4638 '06' => 'Saint Andrew',
4639 '07' => 'Saint David',
4640 '08' => 'Saint George',
4641 '09' => 'Saint Patrick',
4642 '10' => 'San Fernando',
4643 '11' => 'Tobago',
4644 '12' => 'Victoria'
4645 },
4646 'TW' => {
4647 '01' => 'Fu-chien',
4648 '02' => 'Kao-hsiung',
4649 '03' => 'T\'ai-pei',
4650 '04' => 'T\'ai-wan'
4651 },
4652 'TZ' => {
4653 '02' => 'Pwani',
4654 '03' => 'Dodoma',
4655 '04' => 'Iringa',
4656 '05' => 'Kigoma',
4657 '06' => 'Kilimanjaro',
4658 '07' => 'Lindi',
4659 '08' => 'Mara',
4660 '09' => 'Mbeya',
4661 '10' => 'Morogoro',
4662 '11' => 'Mtwara',
4663 '12' => 'Mwanza',
4664 '13' => 'Pemba North',
4665 '14' => 'Ruvuma',
4666 '15' => 'Shinyanga',
4667 '16' => 'Singida',
4668 '17' => 'Tabora',
4669 '18' => 'Tanga',
4670 '19' => 'Kagera',
4671 '20' => 'Pemba South',
4672 '21' => 'Zanzibar Central',
4673 '22' => 'Zanzibar North',
4674 '23' => 'Dar es Salaam',
4675 '24' => 'Rukwa',
4676 '25' => 'Zanzibar Urban',
4677 '26' => 'Arusha',
4678 '27' => 'Manyara'
4679 },
4680 'UA' => {
4681 '01' => 'Cherkas\'ka Oblast\'',
4682 '02' => 'Chernihivs\'ka Oblast\'',
4683 '03' => 'Chernivets\'ka Oblast\'',
4684 '04' => 'Dnipropetrovs\'ka Oblast\'',
4685 '05' => 'Donets\'ka Oblast\'',
4686 '06' => 'Ivano-Frankivs\'ka Oblast\'',
4687 '07' => 'Kharkivs\'ka Oblast\'',
4688 '08' => 'Khersons\'ka Oblast\'',
4689 '09' => 'Khmel\'nyts\'ka Oblast\'',
4690 '10' => 'Kirovohrads\'ka Oblast\'',
4691 '11' => 'Krym',
4692 '12' => 'Kyyiv',
4693 '13' => 'Kyyivs\'ka Oblast\'',
4694 '14' => 'Luhans\'ka Oblast\'',
4695 '15' => 'L\'vivs\'ka Oblast\'',
4696 '16' => 'Mykolayivs\'ka Oblast\'',
4697 '17' => 'Odes\'ka Oblast\'',
4698 '18' => 'Poltavs\'ka Oblast\'',
4699 '19' => 'Rivnens\'ka Oblast\'',
4700 '20' => 'Sevastopol\'',
4701 '21' => 'Sums\'ka Oblast\'',
4702 '22' => 'Ternopil\'s\'ka Oblast\'',
4703 '23' => 'Vinnyts\'ka Oblast\'',
4704 '24' => 'Volyns\'ka Oblast\'',
4705 '25' => 'Zakarpats\'ka Oblast\'',
4706 '26' => 'Zaporiz\'ka Oblast\'',
4707 '27' => 'Zhytomyrs\'ka Oblast\''
4708 },
4709 'UG' => {
4710 '26' => 'Apac',
4711 '28' => 'Bundibugyo',
4712 '29' => 'Bushenyi',
4713 '30' => 'Gulu',
4714 '31' => 'Hoima',
4715 '33' => 'Jinja',
4716 '36' => 'Kalangala',
4717 '37' => 'Kampala',
4718 '38' => 'Kamuli',
4719 '39' => 'Kapchorwa',
4720 '40' => 'Kasese',
4721 '41' => 'Kibale',
4722 '42' => 'Kiboga',
4723 '43' => 'Kisoro',
4724 '45' => 'Kotido',
4725 '46' => 'Kumi',
4726 '47' => 'Lira',
4727 '50' => 'Masindi',
4728 '52' => 'Mbarara',
4729 '56' => 'Mubende',
4730 '58' => 'Nebbi',
4731 '59' => 'Ntungamo',
4732 '60' => 'Pallisa',
4733 '61' => 'Rakai',
4734 '65' => 'Adjumani',
4735 '66' => 'Bugiri',
4736 '67' => 'Busia',
4737 '69' => 'Katakwi',
4738 '70' => 'Luwero',
4739 '71' => 'Masaka',
4740 '72' => 'Moyo',
4741 '73' => 'Nakasongola',
4742 '74' => 'Sembabule',
4743 '76' => 'Tororo',
4744 '77' => 'Arua',
4745 '78' => 'Iganga',
4746 '79' => 'Kabarole',
4747 '80' => 'Kaberamaido',
4748 '81' => 'Kamwenge',
4749 '82' => 'Kanungu',
4750 '83' => 'Kayunga',
4751 '84' => 'Kitgum',
4752 '85' => 'Kyenjojo',
4753 '86' => 'Mayuge',
4754 '87' => 'Mbale',
4755 '88' => 'Moroto',
4756 '89' => 'Mpigi',
4757 '90' => 'Mukono',
4758 '91' => 'Nakapiripirit',
4759 '92' => 'Pader',
4760 '93' => 'Rukungiri',
4761 '94' => 'Sironko',
4762 '95' => 'Soroti',
4763 '96' => 'Wakiso',
4764 '97' => 'Yumbe'
4765 },
4766 'US' => {
4767 'AA' => 'Armed Forces Americas',
4768 'AE' => 'Armed Forces Europe, Middle East, & Canada',
4769 'AK' => 'Alaska',
4770 'AL' => 'Alabama',
4771 'AP' => 'Armed Forces Pacific',
4772 'AR' => 'Arkansas',
4773 'AS' => 'American Samoa',
4774 'AZ' => 'Arizona',
4775 'CA' => 'California',
4776 'CO' => 'Colorado',
4777 'CT' => 'Connecticut',
4778 'DC' => 'District of Columbia',
4779 'DE' => 'Delaware',
4780 'FL' => 'Florida',
4781 'FM' => 'Federated States of Micronesia',
4782 'GA' => 'Georgia',
4783 'GU' => 'Guam',
4784 'HI' => 'Hawaii',
4785 'IA' => 'Iowa',
4786 'ID' => 'Idaho',
4787 'IL' => 'Illinois',
4788 'IN' => 'Indiana',
4789 'KS' => 'Kansas',
4790 'KY' => 'Kentucky',
4791 'LA' => 'Louisiana',
4792 'MA' => 'Massachusetts',
4793 'MD' => 'Maryland',
4794 'ME' => 'Maine',
4795 'MH' => 'Marshall Islands',
4796 'MI' => 'Michigan',
4797 'MN' => 'Minnesota',
4798 'MO' => 'Missouri',
4799 'MP' => 'Northern Mariana Islands',
4800 'MS' => 'Mississippi',
4801 'MT' => 'Montana',
4802 'NC' => 'North Carolina',
4803 'ND' => 'North Dakota',
4804 'NE' => 'Nebraska',
4805 'NH' => 'New Hampshire',
4806 'NJ' => 'New Jersey',
4807 'NM' => 'New Mexico',
4808 'NV' => 'Nevada',
4809 'NY' => 'New York',
4810 'OH' => 'Ohio',
4811 'OK' => 'Oklahoma',
4812 'OR' => 'Oregon',
4813 'PA' => 'Pennsylvania',
4814 'PW' => 'Palau',
4815 'RI' => 'Rhode Island',
4816 'SC' => 'South Carolina',
4817 'SD' => 'South Dakota',
4818 'TN' => 'Tennessee',
4819 'TX' => 'Texas',
4820 'UT' => 'Utah',
4821 'VA' => 'Virginia',
4822 'VI' => 'Virgin Islands',
4823 'VT' => 'Vermont',
4824 'WA' => 'Washington',
4825 'WI' => 'Wisconsin',
4826 'WV' => 'West Virginia',
4827 'WY' => 'Wyoming'
4828 },
4829 'UY' => {
4830 '01' => 'Artigas',
4831 '02' => 'Canelones',
4832 '03' => 'Cerro Largo',
4833 '04' => 'Colonia',
4834 '05' => 'Durazno',
4835 '06' => 'Flores',
4836 '07' => 'Florida',
4837 '08' => 'Lavalleja',
4838 '09' => 'Maldonado',
4839 '10' => 'Montevideo',
4840 '11' => 'Paysandu',
4841 '12' => 'Rio Negro',
4842 '13' => 'Rivera',
4843 '14' => 'Rocha',
4844 '15' => 'Salto',
4845 '16' => 'San Jose',
4846 '17' => 'Soriano',
4847 '18' => 'Tacuarembo',
4848 '19' => 'Treinta y Tres'
4849 },
4850 'UZ' => {
4851 '01' => 'Andijon',
4852 '02' => 'Bukhoro',
4853 '03' => 'Farghona',
4854 '04' => 'Jizzakh',
4855 '05' => 'Khorazm',
4856 '06' => 'Namangan',
4857 '07' => 'Nawoiy',
4858 '08' => 'Qashqadaryo',
4859 '09' => 'Qoraqalpoghiston',
4860 '10' => 'Samarqand',
4861 '11' => 'Sirdaryo',
4862 '12' => 'Surkhondaryo',
4863 '13' => 'Toshkent',
4864 '14' => 'Toshkent',
4865 '15' => 'Jizzax'
4866 },
4867 'VC' => {
4868 '01' => 'Charlotte',
4869 '02' => 'Saint Andrew',
4870 '03' => 'Saint David',
4871 '04' => 'Saint George',
4872 '05' => 'Saint Patrick',
4873 '06' => 'Grenadines'
4874 },
4875 'VE' => {
4876 '01' => 'Amazonas',
4877 '02' => 'Anzoategui',
4878 '03' => 'Apure',
4879 '04' => 'Aragua',
4880 '05' => 'Barinas',
4881 '06' => 'Bolivar',
4882 '07' => 'Carabobo',
4883 '08' => 'Cojedes',
4884 '09' => 'Delta Amacuro',
4885 '11' => 'Falcon',
4886 '12' => 'Guarico',
4887 '13' => 'Lara',
4888 '14' => 'Merida',
4889 '15' => 'Miranda',
4890 '16' => 'Monagas',
4891 '17' => 'Nueva Esparta',
4892 '18' => 'Portuguesa',
4893 '19' => 'Sucre',
4894 '20' => 'Tachira',
4895 '21' => 'Trujillo',
4896 '22' => 'Yaracuy',
4897 '23' => 'Zulia',
4898 '24' => 'Dependencias Federales',
4899 '25' => 'Distrito Federal',
4900 '26' => 'Vargas'
4901 },
4902 'VN' => {
4903 '01' => 'An Giang',
4904 '03' => 'Ben Tre',
4905 '05' => 'Cao Bang',
4906 '09' => 'Dong Thap',
4907 '13' => 'Hai Phong',
4908 '20' => 'Ho Chi Minh',
4909 '21' => 'Kien Giang',
4910 '23' => 'Lam Dong',
4911 '24' => 'Long An',
4912 '30' => 'Quang Ninh',
4913 '32' => 'Son La',
4914 '33' => 'Tay Ninh',
4915 '34' => 'Thanh Hoa',
4916 '35' => 'Thai Binh',
4917 '37' => 'Tien Giang',
4918 '39' => 'Lang Son',
4919 '43' => 'Dong Nai',
4920 '44' => 'Ha Noi',
4921 '45' => 'Ba Ria-Vung Tau',
4922 '46' => 'Binh Dinh',
4923 '47' => 'Binh Thuan',
4924 '49' => 'Gia Lai',
4925 '50' => 'Ha Giang',
4926 '52' => 'Ha Tinh',
4927 '53' => 'Hoa Binh',
4928 '54' => 'Khanh Hoa',
4929 '55' => 'Kon Tum',
4930 '58' => 'Nghe An',
4931 '59' => 'Ninh Binh',
4932 '60' => 'Ninh Thuan',
4933 '61' => 'Phu Yen',
4934 '62' => 'Quang Binh',
4935 '63' => 'Quang Ngai',
4936 '64' => 'Quang Tri',
4937 '65' => 'Soc Trang',
4938 '66' => 'Thua Thien-Hue',
4939 '67' => 'Tra Vinh',
4940 '68' => 'Tuyen Quang',
4941 '69' => 'Vinh Long',
4942 '70' => 'Yen Bai',
4943 '71' => 'Bac Giang',
4944 '72' => 'Bac Kan',
4945 '73' => 'Bac Lieu',
4946 '74' => 'Bac Ninh',
4947 '75' => 'Binh Duong',
4948 '76' => 'Binh Phuoc',
4949 '77' => 'Ca Mau',
4950 '78' => 'Da Nang',
4951 '79' => 'Hai Duong',
4952 '80' => 'Ha Nam',
4953 '81' => 'Hung Yen',
4954 '82' => 'Nam Dinh',
4955 '83' => 'Phu Tho',
4956 '84' => 'Quang Nam',
4957 '85' => 'Thai Nguyen',
4958 '86' => 'Vinh Phuc',
4959 '87' => 'Can Tho',
4960 '88' => 'Dac Lak',
4961 '89' => 'Lai Chau',
4962 '90' => 'Lao Cai',
4963 '91' => 'Dak Nong',
4964 '92' => 'Dien Bien',
4965 '93' => 'Hau Giang'
4966 },
4967 'VU' => {
4968 '05' => 'Ambrym',
4969 '06' => 'Aoba',
4970 '07' => 'Torba',
4971 '08' => 'Efate',
4972 '09' => 'Epi',
4973 '10' => 'Malakula',
4974 '11' => 'Paama',
4975 '12' => 'Pentecote',
4976 '13' => 'Sanma',
4977 '14' => 'Shepherd',
4978 '15' => 'Tafea',
4979 '16' => 'Malampa',
4980 '17' => 'Penama',
4981 '18' => 'Shefa'
4982 },
4983 'WS' => {
4984 '02' => 'Aiga-i-le-Tai',
4985 '03' => 'Atua',
4986 '04' => 'Fa',
4987 '05' => 'Gaga',
4988 '06' => 'Va',
4989 '07' => 'Gagaifomauga',
4990 '08' => 'Palauli',
4991 '09' => 'Satupa',
4992 '10' => 'Tuamasaga',
4993 '11' => 'Vaisigano'
4994 },
4995 'YE' => {
4996 '01' => 'Abyan',
4997 '02' => 'Adan',
4998 '03' => 'Al Mahrah',
4999 '04' => 'Hadramawt',
5000 '05' => 'Shabwah',
5001 '06' => 'Lahij',
5002 '07' => 'Al Bayda\'',
5003 '08' => 'Al Hudaydah',
5004 '09' => 'Al Jawf',
5005 '10' => 'Al Mahwit',
5006 '11' => 'Dhamar',
5007 '12' => 'Hajjah',
5008 '13' => 'Ibb',
5009 '14' => 'Ma\'rib',
5010 '15' => 'Sa\'dah',
5011 '16' => 'San\'a\'',
5012 '17' => 'Taizz',
5013 '18' => 'Ad Dali',
5014 '19' => 'Amran',
5015 '20' => 'Al Bayda\'',
5016 '21' => 'Al Jawf',
5017 '22' => 'Hajjah',
5018 '23' => 'Ibb',
5019 '24' => 'Lahij',
5020 '25' => 'Taizz'
5021 },
5022 'ZA' => {
5023 '01' => 'North-Western Province',
5024 '02' => 'KwaZulu-Natal',
5025 '03' => 'Free State',
5026 '05' => 'Eastern Cape',
5027 '06' => 'Gauteng',
5028 '07' => 'Mpumalanga',
5029 '08' => 'Northern Cape',
5030 '09' => 'Limpopo',
5031 '10' => 'North-West',
5032 '11' => 'Western Cape'
5033 },
5034 'ZM' => {
5035 '01' => 'Western',
5036 '02' => 'Central',
5037 '03' => 'Eastern',
5038 '04' => 'Luapula',
5039 '05' => 'Northern',
5040 '06' => 'North-Western',
5041 '07' => 'Southern',
5042 '08' => 'Copperbelt',
5043 '09' => 'Lusaka'
5044 },
5045 'ZW' => {
5046 '01' => 'Manicaland',
5047 '02' => 'Midlands',
5048 '03' => 'Mashonaland Central',
5049 '04' => 'Mashonaland East',
5050 '05' => 'Mashonaland West',
5051 '06' => 'Matabeleland North',
5052 '07' => 'Matabeleland South',
5053 '08' => 'Masvingo',
5054 '09' => 'Bulawayo',
5055 '10' => 'Harare'
5056 }
5057 );
5058  
5059 sub continent_code_by_country_code {
5060 my $id = $_id_by_code{ $_[1] } || 0;
5061 return $continents[$id];
5062 }
5063 sub time_zone { Geo::IP::Record->_time_zone( $_[1], $_[2] ) }
5064  
5065 sub _get_region_name {
5066 my ( $ccode, $region ) = @_;
5067 return unless $region;
5068 return if $region eq '00';
5069  
5070 return $country_region_names{$ccode}->{$region}
5071 if exists $country_region_names{$ccode};
5072 }
5073  
5074 # --- unfortunately we do not know the path so we assume the
5075 # default path /usr/local/share/GeoIP
5076 # if thats not true, you can set $Geo::IP::PP_OPEN_TYPE_PATH
5077 #
5078 sub open_type {
5079 my ( $class, $type, $flags ) = @_;
5080 my %type_dat_name_mapper = (
5081 GEOIP_COUNTRY_EDITION() => 'GeoIP',
5082 GEOIP_COUNTRY_EDITION_V6() => 'GeoIPv6',
5083 GEOIP_REGION_EDITION_REV0() => 'GeoIPRegion',
5084 GEOIP_REGION_EDITION_REV1() => 'GeoIPRegion',
5085 GEOIP_CITY_EDITION_REV0() => 'GeoIPCity',
5086 GEOIP_CITY_EDITION_REV1() => 'GeoIPCity',
5087 GEOIP_CITY_EDITION_REV0_V6() => 'GeoIPCityv6',
5088 GEOIP_CITY_EDITION_REV1_V6() => 'GeoIPCityv6',
5089 GEOIP_ISP_EDITION() => 'GeoIPISP',
5090 GEOIP_ORG_EDITION() => 'GeoIPOrg',
5091 GEOIP_PROXY_EDITION() => 'GeoIPProxy',
5092 GEOIP_ASNUM_EDITION() => 'GeoIPASNum',
5093 GEOIP_ASNUM_EDITION_V6() => 'GeoIPASNumv6',
5094 GEOIP_NETSPEED_EDITION() => 'GeoIPNetSpeed',
5095 GEOIP_NETSPEED_EDITION_REV1() => 'GeoIPNetSpeed',
5096 GEOIP_DOMAIN_EDITION() => 'GeoIPDomain',
5097 );
5098  
5099 # backward compatibility for 2003 databases.
5100 $type -= 105 if $type >= 106;
5101  
5102 my $name = $type_dat_name_mapper{$type};
5103 die("Invalid database type $type\n") unless $name;
5104  
5105 my $mkpath = sub { File::Spec->catfile( File::Spec->rootdir, @_ ) };
5106  
5107 my $path
5108 = defined $Geo::IP::PP_OPEN_TYPE_PATH
5109 ? $Geo::IP::PP_OPEN_TYPE_PATH
5110 : do {
5111 $^O eq 'NetWare'
5112 ? $mkpath->(qw/ etc GeoIP /)
5113 : do {
5114 $^O eq 'MSWin32'
5115 ? $mkpath->(qw/ GeoIP /)
5116 : $mkpath->(qw/ usr local share GeoIP /);
5117 }
5118 };
5119  
5120 my $filename = File::Spec->catfile( $path, $name . '.dat' );
5121 return $class->open( $filename, $flags );
5122 }
5123  
5124 sub open {
5125 die "Geo::IP::open() requires a path name"
5126 unless ( @_ > 1 and $_[1] );
5127 my ( $class, $db_file, $flags ) = @_;
5128 my $fh = FileHandle->new;
5129 my $gi;
5130 CORE::open $fh, "$db_file" or die "Error opening $db_file";
5131 binmode($fh);
5132 if ( $flags && ( $flags & ( GEOIP_MEMORY_CACHE | GEOIP_MMAP_CACHE ) ) ) {
5133 my %self;
5134 if ( $flags & GEOIP_MMAP_CACHE ) {
5135 die "Sys::Mmap required for MMAP support"
5136 unless defined $Sys::Mmap::VERSION;
5137 mmap( $self{buf} = undef, 0, PROT_READ, MAP_PRIVATE, $fh )
5138 or die "mmap: $!";
5139 }
5140 else {
5141 local $/ = undef;
5142 $self{buf} = <$fh>;
5143 }
5144 $self{fh} = $fh;
5145 $gi = bless \%self, $class;
5146 }
5147 else {
5148 $gi = bless { fh => $fh }, $class;
5149 }
5150 $gi->_setup_segments();
5151 return $gi;
5152 }
5153  
5154 sub new {
5155 my ( $class, $db_file, $flags ) = @_;
5156  
5157 # this will be less messy once deprecated new( $path, [$flags] )
5158 # is no longer supported (that's what open() is for)
5159 my $def_db_file = '/usr/local/share/GeoIP/GeoIP.dat';
5160 if ( $^O eq 'NetWare' ) {
5161 $def_db_file = 'sys:/etc/GeoIP/GeoIP.dat';
5162 }
5163 elsif ( $^O eq 'MSWin32' ) {
5164 $def_db_file = 'c:/GeoIP/GeoIP.dat';
5165 }
5166 if ( !defined $db_file ) {
5167  
5168 # called as new()
5169 $db_file = $def_db_file;
5170 }
5171 elsif ( $db_file =~ /^\d+$/ ) {
5172  
5173 # called as new( $flags )
5174 $flags = $db_file;
5175 $db_file = $def_db_file;
5176 } # else called as new( $database_filename, [$flags] );
5177  
5178 $class->open( $db_file, $flags );
5179 }
5180  
5181 #this function setups the database segments
5182 sub _setup_segments {
5183 my ($gi) = @_;
5184 my $a = 0;
5185 my $i = 0;
5186 my $j = 0;
5187 my $delim;
5188 my $buf;
5189  
5190 $gi->{_charset} = GEOIP_CHARSET_ISO_8859_1;
5191 $gi->{"databaseType"} = GEOIP_COUNTRY_EDITION;
5192 $gi->{"record_length"} = STANDARD_RECORD_LENGTH;
5193  
5194 my $filepos = tell( $gi->{fh} );
5195 seek( $gi->{fh}, -3, 2 );
5196 for ( $i = 0 ; $i < STRUCTURE_INFO_MAX_SIZE ; $i++ ) {
5197 read( $gi->{fh}, $delim, 3 );
5198  
5199 #find the delim
5200 if ( $delim eq ( chr(255) . chr(255) . chr(255) ) ) {
5201 read( $gi->{fh}, $a, 1 );
5202  
5203 #read the databasetype
5204 my $database_type = ord($a);
5205  
5206 # backward compatibility for 2003 databases.
5207 $database_type -= 105 if $database_type >= 106;
5208 $gi->{"databaseType"} = $database_type;
5209  
5210 #chose the database segment for the database type
5211 #if database Type is GEOIP_REGION_EDITION then use database segment GEOIP_STATE_BEGIN
5212 if ( $gi->{"databaseType"} == GEOIP_REGION_EDITION_REV0 ) {
5213 $gi->{"databaseSegments"} = GEOIP_STATE_BEGIN_REV0;
5214 }
5215 elsif ( $gi->{"databaseType"} == GEOIP_REGION_EDITION_REV1 ) {
5216 $gi->{"databaseSegments"} = GEOIP_STATE_BEGIN_REV1;
5217 }
5218  
5219 #if database Type is GEOIP_CITY_EDITION, GEOIP_ISP_EDITION or GEOIP_ORG_EDITION then
5220 #read in the database segment
5221 elsif (( $gi->{"databaseType"} == GEOIP_CITY_EDITION_REV0 )
5222 || ( $gi->{"databaseType"} == GEOIP_CITY_EDITION_REV1 )
5223 || ( $gi->{"databaseType"} == GEOIP_CITY_EDITION_REV0_V6 )
5224 || ( $gi->{"databaseType"} == GEOIP_CITY_EDITION_REV1_V6 )
5225 || ( $gi->{"databaseType"} == GEOIP_ORG_EDITION )
5226 || ( $gi->{"databaseType"} == GEOIP_DOMAIN_EDITION )
5227 || ( $gi->{"databaseType"} == GEOIP_ASNUM_EDITION )
5228 || ( $gi->{"databaseType"} == GEOIP_ASNUM_EDITION_V6 )
5229 || ( $gi->{"databaseType"} == GEOIP_NETSPEED_EDITION_REV1 )
5230 || ( $gi->{"databaseType"} == GEOIP_ISP_EDITION ) ) {
5231 $gi->{"databaseSegments"} = 0;
5232  
5233 #read in the database segment for the database type
5234 read( $gi->{fh}, $buf, SEGMENT_RECORD_LENGTH );
5235 for ( $j = 0 ; $j < SEGMENT_RECORD_LENGTH ; $j++ ) {
5236 $gi->{"databaseSegments"}
5237 += ( ord( substr( $buf, $j, 1 ) ) << ( $j * 8 ) );
5238 }
5239  
5240 #record length is four for ISP databases and ORG databases
5241 #record length is three for country databases, region database and city databases
5242 if ( $gi->{"databaseType"} == GEOIP_ORG_EDITION
5243 || $gi->{"databaseType"} == GEOIP_ISP_EDITION
5244 || $gi->{"databaseType"} == GEOIP_DOMAIN_EDITION ) {
5245 $gi->{"record_length"} = ORG_RECORD_LENGTH;
5246 }
5247 }
5248 last;
5249 }
5250 else {
5251 seek( $gi->{fh}, -4, 1 );
5252 }
5253 }
5254  
5255 #if database Type is GEOIP_COUNTY_EDITION then use database segment GEOIP_COUNTRY_BEGIN
5256 if ( $gi->{"databaseType"} == GEOIP_COUNTRY_EDITION
5257 || $gi->{"databaseType"} == GEOIP_COUNTRY_EDITION_V6
5258 || $gi->{"databaseType"} == GEOIP_NETSPEED_EDITION ) {
5259 $gi->{"databaseSegments"} = GEOIP_COUNTRY_BEGIN;
5260 }
5261 seek( $gi->{fh}, $filepos, 0 );
5262 return $gi;
5263 }
5264  
5265 sub _seek_country {
5266 my ( $gi, $ipnum ) = @_;
5267  
5268 my $fh = $gi->{fh};
5269 my $offset = 0;
5270  
5271 my ( $x0, $x1 );
5272  
5273 my $reclen = $gi->{record_length};
5274  
5275 for ( my $depth = 31 ; $depth >= 0 ; $depth-- ) {
5276 unless ( exists $gi->{buf} ) {
5277 seek $fh, $offset * 2 * $reclen, 0;
5278 read $fh, $x0, $reclen;
5279 read $fh, $x1, $reclen;
5280 }
5281 else {
5282 $x0 = substr( $gi->{buf}, $offset * 2 * $reclen, $reclen );
5283 $x1 = substr( $gi->{buf}, $offset * 2 * $reclen + $reclen,
5284 $reclen );
5285 }
5286  
5287 $x0 = unpack( "V1", $x0 . "\0" );
5288 $x1 = unpack( "V1", $x1 . "\0" );
5289  
5290 if ( $ipnum & ( 1 << $depth ) ) {
5291 if ( $x1 >= $gi->{"databaseSegments"} ) {
5292 $gi->{last_netmask} = 32 - $depth;
5293 return $x1;
5294 }
5295 $offset = $x1;
5296 }
5297 else {
5298 if ( $x0 >= $gi->{"databaseSegments"} ) {
5299 $gi->{last_netmask} = 32 - $depth;
5300 return $x0;
5301 }
5302 $offset = $x0;
5303 }
5304 }
5305  
5306 print STDERR
5307 "Error Traversing Database for ipnum = $ipnum - Perhaps database is corrupt?";
5308 }
5309  
5310 sub charset {
5311 return $_[0]->{_charset};
5312 }
5313  
5314 sub set_charset {
5315 my ( $gi, $charset ) = @_;
5316 my $old_charset = $gi->{_charset};
5317 $gi->{_charset} = $charset;
5318 return $old_charset;
5319 }
5320  
5321 #this function returns the country code of ip address
5322 sub country_code_by_addr {
5323 my ( $gi, $ip_address ) = @_;
5324 return unless $ip_address =~ m!^(?:\d{1,3}\.){3}\d{1,3}$!;
5325 return $countries[ $gi->id_by_addr($ip_address) ];
5326 }
5327  
5328 #this function returns the country code3 of ip address
5329 sub country_code3_by_addr {
5330 my ( $gi, $ip_address ) = @_;
5331 return unless $ip_address =~ m!^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$!;
5332 return $code3s[ $gi->id_by_addr($ip_address) ];
5333 }
5334  
5335 #this function returns the name of ip address
5336 sub country_name_by_addr {
5337 my ( $gi, $ip_address ) = @_;
5338 return unless $ip_address =~ m!^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$!;
5339 return $names[ $gi->id_by_addr($ip_address) ];
5340 }
5341  
5342 sub id_by_addr {
5343 my ( $gi, $ip_address ) = @_;
5344 return unless $ip_address =~ m!^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$!;
5345 return $gi->_seek_country( addr_to_num($ip_address) )
5346 - GEOIP_COUNTRY_BEGIN;
5347 }
5348  
5349 #this function returns the country code of domain name
5350 sub country_code_by_name {
5351 my ( $gi, $host ) = @_;
5352 my $country_id = $gi->id_by_name($host);
5353 return $countries[$country_id];
5354 }
5355  
5356 #this function returns the country code3 of domain name
5357 sub country_code3_by_name {
5358 my ( $gi, $host ) = @_;
5359 my $country_id = $gi->id_by_name($host);
5360 return $code3s[$country_id];
5361 }
5362  
5363 #this function returns the country name of domain name
5364 sub country_name_by_name {
5365 my ( $gi, $host ) = @_;
5366 my $country_id = $gi->id_by_name($host);
5367 return $names[$country_id];
5368 }
5369  
5370 sub id_by_name {
5371 my ( $gi, $host ) = @_;
5372 my $ip_address;
5373 if ( $host =~ m!^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$! ) {
5374 $ip_address = $host;
5375 }
5376 else {
5377 $ip_address
5378 = join( '.', unpack( 'C4', ( gethostbyname($host) )[4] ) );
5379 }
5380 return unless $ip_address;
5381 return $gi->_seek_country( addr_to_num($ip_address) )
5382 - GEOIP_COUNTRY_BEGIN;
5383 }
5384  
5385 #this function returns the city record as a hash ref
5386 sub get_city_record_as_hash {
5387 my ( $gi, $host ) = @_;
5388 my %gir;
5389  
5390 @gir{
5391 qw/ country_code country_code3 country_name region city
5392 postal_code latitude longitude dma_code area_code
5393 continent_code region_name metro_code /
5394 } = $gi->get_city_record($host);
5395  
5396 return
5397 defined( $gir{latitude} ) ? bless( \%gir, 'Geo::IP::Record' ) : undef;
5398 }
5399  
5400 *record_by_addr = \&get_city_record_as_hash;
5401 *record_by_name = \&get_city_record_as_hash;
5402  
5403 sub org_by_name {
5404 my ( $gi, $host ) = @_;
5405 return $gi->org_by_addr( $gi->get_ip_address($host) );
5406 }
5407  
5408 #this function returns isp or org of the domain name
5409 sub org_by_addr {
5410 my ( $gi, $ip_address ) = @_;
5411 my $seek_org = $gi->_seek_country( addr_to_num($ip_address) );
5412  
5413 return $gi->_common_org($seek_org);
5414 }
5415  
5416 sub _common_org {
5417 my ($gi, $seek_org) = @_;
5418  
5419 my $char;
5420 my $org_buf;
5421 my $record_pointer;
5422  
5423 if ( $seek_org == $gi->{"databaseSegments"} ) {
5424 return undef;
5425 }
5426  
5427 $record_pointer = $seek_org
5428 + ( 2 * $gi->{"record_length"} - 1 ) * $gi->{"databaseSegments"};
5429  
5430 unless ( exists $gi->{buf} ) {
5431 seek( $gi->{"fh"}, $record_pointer, 0 );
5432 read( $gi->{"fh"}, $org_buf, MAX_ORG_RECORD_LENGTH );
5433 }
5434 else {
5435 $org_buf
5436 = substr( $gi->{buf}, $record_pointer, MAX_ORG_RECORD_LENGTH );
5437 }
5438  
5439 $org_buf = unpack 'Z*' => $org_buf;
5440  
5441 $org_buf = decode( 'iso-8859-1' => $org_buf )
5442 if $gi->charset == GEOIP_CHARSET_UTF8;
5443  
5444 return $org_buf;
5445 }
5446  
5447 #this function returns isp or org of the domain name
5448 *isp_by_name = \*org_by_name;
5449 *isp_by_addr = \*org_by_addr;
5450 *name_by_addr = \*org_by_addr;
5451 *name_by_name = \*org_by_name;
5452  
5453 #this function returns the region
5454 sub region_by_name {
5455 my ( $gi, $host ) = @_;
5456 my $ip_address = $gi->get_ip_address($host);
5457 return unless $ip_address;
5458 if ( $gi->{"databaseType"} == GEOIP_REGION_EDITION_REV0 ) {
5459 my $seek_region = $gi->_seek_country( addr_to_num($ip_address) )
5460 - GEOIP_STATE_BEGIN_REV0;
5461 if ( $seek_region >= 1000 ) {
5462 return (
5463 "US",
5464 chr( ( $seek_region - 1000 ) / 26 + 65 )
5465 . chr( ( $seek_region - 1000 ) % 26 + 65 )
5466 );
5467 }
5468 else {
5469 return ( $countries[$seek_region], "" );
5470 }
5471 }
5472 elsif ( $gi->{"databaseType"} == GEOIP_REGION_EDITION_REV1 ) {
5473 my $seek_region = $gi->_seek_country( addr_to_num($ip_address) )
5474 - GEOIP_STATE_BEGIN_REV1;
5475 if ( $seek_region < US_OFFSET ) {
5476 return ( "", "" );
5477 }
5478 elsif ( $seek_region < CANADA_OFFSET ) {
5479  
5480 # return a us state
5481 return (
5482 "US",
5483 chr( ( $seek_region - US_OFFSET ) / 26 + 65 )
5484 . chr( ( $seek_region - US_OFFSET ) % 26 + 65 )
5485 );
5486 }
5487 elsif ( $seek_region < WORLD_OFFSET ) {
5488  
5489 # return a canada province
5490 return (
5491 "CA",
5492 chr( ( $seek_region - CANADA_OFFSET ) / 26 + 65 )
5493 . chr( ( $seek_region - CANADA_OFFSET ) % 26 + 65 )
5494 );
5495 }
5496 else {
5497  
5498 # return a country of the world
5499 my $c
5500 = $countries[ ( $seek_region - WORLD_OFFSET ) / FIPS_RANGE ];
5501 my $a2 = ( $seek_region - WORLD_OFFSET ) % FIPS_RANGE;
5502  
5503 ## my $r =
5504 ## chr( ( $a2 / 100 ) + 48 )
5505 ## . chr( ( ( $a2 / 10 ) % 10 ) + 48 )
5506 ## . chr( ( $a2 % 10 ) + 48 );
5507 return ( $c, $a2 ? sprintf( '%03d', $a2 ) : '00' );
5508 }
5509 }
5510 }
5511  
5512 *region_by_addr = \&region_by_name;
5513  
5514 sub get_ip_address {
5515 my ( $gi, $host ) = @_;
5516 my $ip_address;
5517  
5518 #check if host is ip address
5519 if ( $host =~ m!^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$! ) {
5520  
5521 #host is ip address
5522 $ip_address = $host;
5523 }
5524 else {
5525  
5526 #host is domain name do a dns lookup
5527 $ip_address
5528 = join( '.', unpack( 'C4', ( gethostbyname($host) )[4] ) );
5529 }
5530 return $ip_address;
5531 }
5532  
5533 sub addr_to_num { unpack( N => pack( C4 => split( /\./, $_[0] ) ) ) }
5534 sub num_to_addr { join q{.}, unpack( C4 => pack( N => $_[0] ) ) }
5535  
5536 #sub addr_to_num {
5537 # my @a = split( '\.', $_[0] );
5538 # return $a[0] * 16777216 + $a[1] * 65536 + $a[2] * 256 + $a[3];
5539 #}
5540  
5541 sub database_edition {
5542 $_[0]->{databaseType};
5543 }
5544  
5545 sub database_info {
5546 my $gi = shift;
5547 my $i = 0;
5548 my $buf;
5549 my $retval;
5550 my $hasStructureInfo = 0;
5551 seek( $gi->{fh}, -3, 2 );
5552 for ( my $i = 0 ; $i < STRUCTURE_INFO_MAX_SIZE ; $i++ ) {
5553 read( $gi->{fh}, $buf, 3 );
5554 if ( $buf eq ( chr(255) . chr(255) . chr(255) ) ) {
5555 $hasStructureInfo = 1;
5556 last;
5557 }
5558 seek( $gi->{fh}, -4, 1 );
5559 }
5560 if ( $hasStructureInfo == 1 ) {
5561 seek( $gi->{fh}, -6, 1 );
5562 }
5563 else {
5564  
5565 # no structure info, must be pre Sep 2002 database, go back to
5566 seek( $gi->{fh}, -3, 2 );
5567 }
5568 for ( my $i = 0 ; $i < DATABASE_INFO_MAX_SIZE ; $i++ ) {
5569 read( $gi->{fh}, $buf, 3 );
5570 if ( $buf eq ( chr(0) . chr(0) . chr(0) ) ) {
5571 read( $gi->{fh}, $retval, $i );
5572 return $retval;
5573 }
5574 seek( $gi->{fh}, -4, 1 );
5575 }
5576 return '';
5577 }
5578  
5579 sub range_by_ip {
5580 my $gi = shift;
5581 my $ipnum = addr_to_num(shift);
5582 my $c = $gi->_seek_country($ipnum);
5583 my $nm = $gi->last_netmask;
5584 my $m = 0xffffffff << 32 - $nm;
5585 my $left_seek_num = $ipnum & $m;
5586 my $right_seek_num = $left_seek_num + ( 0xffffffff & ~$m );
5587  
5588 while ( $left_seek_num != 0
5589 and $c == $gi->_seek_country( $left_seek_num - 1 ) ) {
5590 my $lm = 0xffffffff << 32 - $gi->last_netmask;
5591 $left_seek_num = ( $left_seek_num - 1 ) & $lm;
5592 }
5593 while ( $right_seek_num != 0xffffffff
5594 and $c == $gi->_seek_country( $right_seek_num + 1 ) ) {
5595 my $rm = 0xffffffff << 32 - $gi->last_netmask;
5596 $right_seek_num = ( $right_seek_num + 1 ) & $rm;
5597 $right_seek_num += ( 0xffffffff & ~$rm );
5598 }
5599 return ( num_to_addr($left_seek_num), num_to_addr($right_seek_num) );
5600 }
5601  
5602 sub netmask { $_[0]->{last_netmask} = $_[1] }
5603  
5604 sub last_netmask {
5605 return $_[0]->{last_netmask};
5606 }
5607  
5608 sub get_city_record {
5609 my ( $gi, $host ) = @_;
5610 my $ip_address = $gi->get_ip_address($host);
5611 return unless $ip_address;
5612  
5613 #lookup the city
5614 my $seek = $gi->_seek_country( addr_to_num($ip_address) );
5615 return if ( $seek == $gi->{databaseSegments} );
5616 return _get_city_record_seek( $gi, $seek );
5617 }
5618  
5619 #this function returns the city record as a array
5620 sub _get_city_record_seek {
5621 my ( $gi, $seek_position ) = @_;
5622 my $record_buf;
5623 my $record_buf_pos;
5624 my $char;
5625 my $metroarea_combo;
5626 my $record_country_code = '';
5627 my $record_country_code3 = '';
5628 my $record_country_name = '';
5629 my $record_region = undef;
5630 my $record_city = '';
5631 my $record_postal_code = undef;
5632 my $record_latitude = '';
5633 my $record_longitude = '';
5634 my $record_metro_code = 0;
5635 my $record_area_code = 0;
5636 my $record_continent_code = '';
5637 my $record_region_name = undef;
5638 my $str_length = 0;
5639 my $i;
5640 my $j;
5641  
5642 #set the record pointer to location of the city record
5643 my $record_pointer = $seek_position
5644 + ( 2 * $gi->{record_length} - 1 ) * $gi->{databaseSegments};
5645  
5646 unless ( exists $gi->{buf} ) {
5647 seek( $gi->{fh}, $record_pointer, 0 );
5648 read( $gi->{fh}, $record_buf, FULL_RECORD_LENGTH );
5649 $record_buf_pos = 0;
5650 }
5651 else {
5652 $record_buf
5653 = substr( $gi->{buf}, $record_pointer, FULL_RECORD_LENGTH );
5654 $record_buf_pos = 0;
5655 }
5656  
5657 #get the country
5658 $char = ord( substr( $record_buf, $record_buf_pos, 1 ) );
5659 $record_country_code = $countries[$char]; #get the country code
5660 $record_country_code3
5661 = $code3s[$char]; #get the country code with 3 letters
5662 $record_country_name = $names[$char]; #get the country name
5663 $record_buf_pos++;
5664  
5665 # get the continent code
5666 $record_continent_code = $continents[$char];
5667  
5668 #get the region
5669 $char = ord( substr( $record_buf, $record_buf_pos + $str_length, 1 ) );
5670 while ( $char != 0 ) {
5671 $str_length++; #get the length of string
5672 $char
5673 = ord( substr( $record_buf, $record_buf_pos + $str_length, 1 ) );
5674 }
5675 if ( $str_length > 0 ) {
5676 $record_region = substr( $record_buf, $record_buf_pos, $str_length );
5677 }
5678 $record_buf_pos += $str_length + 1;
5679 $str_length = 0;
5680  
5681 #get the city
5682 $char = ord( substr( $record_buf, $record_buf_pos + $str_length, 1 ) );
5683 while ( $char != 0 ) {
5684 $str_length++; #get the length of string
5685 $char
5686 = ord( substr( $record_buf, $record_buf_pos + $str_length, 1 ) );
5687 }
5688 if ( $str_length > 0 ) {
5689 $record_city = substr( $record_buf, $record_buf_pos, $str_length );
5690 }
5691 $record_buf_pos += $str_length + 1;
5692 $str_length = 0;
5693  
5694 #get the postal code
5695 $char = ord( substr( $record_buf, $record_buf_pos + $str_length, 1 ) );
5696 while ( $char != 0 ) {
5697 $str_length++; #get the length of string
5698 $char
5699 = ord( substr( $record_buf, $record_buf_pos + $str_length, 1 ) );
5700 }
5701 if ( $str_length > 0 ) {
5702 $record_postal_code
5703 = substr( $record_buf, $record_buf_pos, $str_length );
5704 }
5705 $record_buf_pos += $str_length + 1;
5706 $str_length = 0;
5707 my $latitude = 0;
5708 my $longitude = 0;
5709  
5710 #get the latitude
5711 for ( $j = 0 ; $j < 3 ; ++$j ) {
5712 $char = ord( substr( $record_buf, $record_buf_pos++, 1 ) );
5713 $latitude += ( $char << ( $j * 8 ) );
5714 }
5715 $record_latitude = ( $latitude / 10000 ) - 180;
5716  
5717 #get the longitude
5718 for ( $j = 0 ; $j < 3 ; ++$j ) {
5719 $char = ord( substr( $record_buf, $record_buf_pos++, 1 ) );
5720 $longitude += ( $char << ( $j * 8 ) );
5721 }
5722 $record_longitude = ( $longitude / 10000 ) - 180;
5723  
5724 #get the metro code and the area code
5725 if ( GEOIP_CITY_EDITION_REV1 == $gi->{databaseType} ) {
5726 $metroarea_combo = 0;
5727 if ( $record_country_code eq 'US' ) {
5728  
5729 #if the country is US then read the dma/metro area combo
5730 for ( $j = 0 ; $j < 3 ; ++$j ) {
5731 $char = ord( substr( $record_buf, $record_buf_pos++, 1 ) );
5732 $metroarea_combo += ( $char << ( $j * 8 ) );
5733 }
5734  
5735 #split the dma/metro area combo into the metro code and the area code
5736 $record_metro_code = int( $metroarea_combo / 1000 );
5737 $record_area_code = $metroarea_combo % 1000;
5738 }
5739 }
5740 $record_region_name
5741 = _get_region_name( $record_country_code, $record_region );
5742  
5743 # the pureperl API must convert the string by themself to UTF8
5744 # using Encode for perl >= 5.008 otherwise use it's own iso-8859-1 to utf8 converter
5745 $record_city = decode( 'iso-8859-1' => $record_city )
5746 if $gi->charset == GEOIP_CHARSET_UTF8;
5747  
5748 return (
5749 $record_country_code, $record_country_code3, $record_country_name,
5750 $record_region, $record_city, $record_postal_code,
5751 $record_latitude, $record_longitude, $record_metro_code,
5752 $record_area_code, $record_continent_code, $record_region_name,
5753 $record_metro_code
5754 );
5755 }
5756  
5757 sub DESTROY {
5758 my $gi = shift;
5759  
5760 if ( exists $gi->{buf}
5761 && $gi->{flags}
5762 && ( $gi->{flags} & GEOIP_MMAP_CACHE ) ) {
5763 munmap( $gi->{buf} ) or die "munmap: $!";
5764 delete $gi->{buf};
5765 }
5766 }
5767  
5768 eval <<'__IPV6__' if $] >= 5.014;
5769 use Socket qw/ getaddrinfo NI_NUMERICHOST SOCK_STREAM unpack_sockaddr_in6 / ;
5770 my $AF_INET6 = eval { Socket::AF_INET6() };
5771  
5772 sub id_by_addr_v6 {
5773 my ( $gi, $ip_address ) = @_;
5774 my $addr = $gi->get_ip_address_v6($ip_address);
5775 return unless $addr;
5776 return $gi->_seek_country_v6($addr) - GEOIP_COUNTRY_BEGIN;
5777 }
5778  
5779 sub _seek_country_v6 {
5780 my ( $gi, $ipnum ) = @_;
5781  
5782 my $fh = $gi->{fh};
5783 my $offset = 0;
5784  
5785 my ( $x0, $x1 );
5786  
5787 my $reclen = $gi->{record_length};
5788  
5789 for my $depth ( 0 .. 127 ) {
5790 unless ( exists $gi->{buf} ) {
5791 seek $fh, $offset * 2 * $reclen, 0;
5792 read $fh, $x0, $reclen;
5793 read $fh, $x1, $reclen;
5794 }
5795 else {
5796 $x0 = substr( $gi->{buf}, $offset * 2 * $reclen, $reclen );
5797 $x1 = substr(
5798 $gi->{buf}, $offset * 2 * $reclen + $reclen,
5799 $reclen
5800 );
5801 }
5802  
5803 $x0 = unpack( "V1", $x0 . "\0" );
5804 $x1 = unpack( "V1", $x1 . "\0" );
5805  
5806 if ( vec( $ipnum, $depth ^ 7, 1 ) ) {
5807 if ( $x1 >= $gi->{databaseSegments} ) {
5808 $gi->{last_netmask} = 1 + $depth;
5809 return $x1;
5810 }
5811 $offset = $x1;
5812 }
5813 else {
5814 if ( $x0 >= $gi->{databaseSegments} ) {
5815 $gi->{last_netmask} = 1 + $depth;
5816 return $x0;
5817 }
5818 $offset = $x0;
5819 }
5820 }
5821  
5822 print STDERR
5823 "Error Traversing Database for ipnum = $ipnum - Perhaps database is corrupt?";
5824 }
5825  
5826 #this function returns the country code of ip address
5827 sub country_code_by_addr_v6 {
5828 my ( $gi, $ip_address ) = @_;
5829 return $countries[ $gi->id_by_addr_v6($ip_address) ];
5830 }
5831  
5832 #this function returns the country code3 of ip address
5833 sub country_code3_by_addr_v6 {
5834 my ( $gi, $ip_address ) = @_;
5835 return $code3s[ $gi->id_by_addr_v6($ip_address) ];
5836 }
5837  
5838 #this function returns the name of ip address
5839 sub country_name_by_addr_v6 {
5840 my ( $gi, $ip_address ) = @_;
5841 return $names[ $gi->id_by_addr_v6($ip_address) ];
5842 }
5843  
5844 #this function returns the country code of domain name
5845 sub country_code_by_name_v6 {
5846 my ( $gi, $host ) = @_;
5847 my $country_id = $gi->id_by_name_v6($host);
5848 return $countries[$country_id];
5849 }
5850  
5851 #this function returns the country code3 of domain name
5852 sub country_code3_by_name_v6 {
5853 my ( $gi, $host ) = @_;
5854 my $country_id = $gi->id_by_name_v6($host);
5855 return $code3s[$country_id];
5856 }
5857  
5858 #this function returns the country name of domain name
5859 sub country_name_by_name_v6 {
5860 my ( $gi, $host ) = @_;
5861 my $country_id = $gi->id_by_name_v6($host);
5862 return $names[$country_id];
5863 }
5864  
5865 sub id_by_name_v6 {
5866 my ( $gi, $host ) = @_;
5867 my $addr = $gi->get_ip_address_v6($host);
5868 return unless $addr;
5869 return $gi->_seek_country_v6($addr) - GEOIP_COUNTRY_BEGIN;
5870 }
5871  
5872 sub org_by_addr_v6 {
5873 my ( $gi, $ip_address ) = @_;
5874  
5875 my $addr = $gi->get_ip_address_v6($ip_address);
5876 return unless $addr;
5877  
5878 my $seek_org = $gi->_seek_country_v6($addr);
5879 return $gi->_common_org($seek_org);
5880 }
5881  
5882 *name_by_addr_v6 = \*org_by_addr_v6;
5883 *name_by_name_v6 = \*org_by_addr_v6;
5884 *org_by_name_v6 = \*org_by_addr_v6;
5885  
5886 sub get_ip_address_v6 {
5887 my ( $gi, $host ) = @_;
5888  
5889 my $hints = { family => $AF_INET6, socktype => SOCK_STREAM, };
5890 $hints->{flags} = NI_NUMERICHOST if ( $host =~ /:/ );
5891  
5892 my ( $err, $data ) = getaddrinfo( $host, undef, $hints );
5893 return $err ? undef : ( unpack_sockaddr_in6( $data->{addr} ) )[1];
5894 }
5895  
5896 sub get_city_record_v6 {
5897 my ( $gi, $host ) = @_;
5898 my $ip_address = $gi->get_ip_address_v6($host);
5899 return unless $ip_address;
5900  
5901 #lookup the city
5902 my $seek = $gi->_seek_country_v6($ip_address);
5903 return if ( $seek == $gi->{databaseSegments} );
5904 return _get_city_record_seek( $gi, $seek );
5905 }
5906  
5907 #this function returns the city record as a hash ref
5908 sub get_city_record_as_hash_v6 {
5909 my ( $gi, $host ) = @_;
5910 my %gir;
5911  
5912 @gir{
5913 qw/ country_code country_code3 country_name region city
5914 postal_code latitude longitude dma_code area_code
5915 continent_code region_name metro_code /
5916 } = $gi->get_city_record_v6($host);
5917  
5918 return
5919 defined( $gir{latitude} ) ? bless( \%gir, 'Geo::IP::Record' ) : undef;
5920 }
5921  
5922 *record_by_addr_v6 = \&get_city_record_as_hash_v6;
5923 *record_by_name_v6 = \&get_city_record_as_hash_v6;
5924 1;
5925 __IPV6__
5926  
5927 1;
5928 #sub _XS
5929 __PP_CODE__
5930  
5931 7 ▶print STDERR $@ if $@;
Branch: 1 branch
BranchTrueFalseTotal
if $@ 0 7 7
5932 7 1;
5933  
5934 # ABSTRACT: Look up location and network information by IP Address
5935  
5936 __END__
↑ Summary IP/Record.pm »