itu_codes 0.3.6 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +37 -24
- data/lib/data/assigned_country_codes.yml +345 -0
- data/lib/data/iso_code_to_itu_country_names.yml +248 -0
- data/lib/data/north_american_area_codes.yml +394 -0
- data/lib/itu_codes/constants.rb +4 -746
- data/lib/itu_codes/helpers.rb +5 -3
- data/lib/itu_codes/version.rb +1 -1
- data/lib/itu_codes.rb +66 -77
- metadata +5 -34
data/README.md
CHANGED
|
@@ -2,60 +2,73 @@
|
|
|
2
2
|
|
|
3
3
|
Helper library for telephone country codes based on the official International Telecommunications Union specifications:
|
|
4
4
|
|
|
5
|
-
* [
|
|
5
|
+
* [List of ITU-T Recommendation E.164 assigned country codes][1]
|
|
6
6
|
* [LIST OF ITU-T RECOMMENDATION E.164 ASSIGNED COUNTRY CODES (POSITION ON 1 NOVEMBER 2011)][2]
|
|
7
7
|
|
|
8
|
+
Country code lookup based on official ISO-3166-1 specifications:
|
|
9
|
+
* [Country Codes - ISO 3166][3]
|
|
10
|
+
* [list of alpha-2 country codes in XML format][4]
|
|
11
|
+
|
|
8
12
|
## Usage:
|
|
9
13
|
|
|
10
|
-
ItuCodes.valid_code? 8392813
|
|
14
|
+
ItuCodes.valid_code? '8392813'
|
|
15
|
+
# => false
|
|
11
16
|
|
|
12
|
-
ItuCodes.valid_code? 7
|
|
17
|
+
ItuCodes.valid_code? '7'
|
|
18
|
+
# => true
|
|
13
19
|
|
|
14
|
-
ItuCodes.parse_code 1818
|
|
20
|
+
ItuCodes.parse_code '1818'
|
|
21
|
+
# => 1
|
|
15
22
|
|
|
16
|
-
ItuCodes.parse_code 822
|
|
23
|
+
ItuCodes.parse_code '822'
|
|
24
|
+
# => "82"
|
|
17
25
|
|
|
18
|
-
ItuCodes.parse_code 4
|
|
26
|
+
ItuCodes.parse_code '4'
|
|
27
|
+
# => nil
|
|
19
28
|
|
|
20
|
-
ItuCodes.
|
|
29
|
+
ItuCodes.find_by_name 'France'
|
|
30
|
+
# => "33"
|
|
21
31
|
|
|
22
|
-
ItuCodes.
|
|
32
|
+
ItuCodes.find_by_itu_code '995'
|
|
33
|
+
# => "Georgia"
|
|
23
34
|
|
|
24
|
-
ItuCodes.
|
|
35
|
+
ItuCodes.find_by_name 'Erewhon'
|
|
36
|
+
# => nil
|
|
25
37
|
|
|
26
|
-
ItuCodes.
|
|
38
|
+
ItuCodes.find_by_itu_code '123123995'
|
|
39
|
+
# => nil
|
|
27
40
|
|
|
28
41
|
# Despite the same 1st digit,
|
|
29
42
|
# these are for different
|
|
30
43
|
# countries ...
|
|
31
|
-
ItuCodes.compatriots? 822, 811
|
|
44
|
+
ItuCodes.compatriots? '822', '811'
|
|
45
|
+
# => false
|
|
32
46
|
|
|
33
47
|
# ... but these are for
|
|
34
48
|
# the same country ...
|
|
35
|
-
ItuCodes.compatriots?
|
|
49
|
+
ItuCodes.compatriots? '1984', '1985'
|
|
50
|
+
# => true
|
|
36
51
|
|
|
37
52
|
# =====================================================
|
|
38
53
|
# = Using 2-letter ISO country codes is most reliable =
|
|
39
54
|
# =====================================================
|
|
40
55
|
# ... and then there's the
|
|
41
56
|
# North American 'situation' ...
|
|
42
|
-
ItuCodes.compatriots? 1264, 1818
|
|
57
|
+
ItuCodes.compatriots? '1264', '1818'
|
|
58
|
+
# => false
|
|
43
59
|
|
|
44
60
|
# Convert from and to ISO 2-letter country codes:
|
|
45
|
-
ItuCodes.iso2itu('US')
|
|
46
|
-
|
|
47
|
-
ItuCodes.itu2iso('1')
|
|
48
|
-
# => ["US", "CA", "AS", "AI", "AG", "BS", "BB", "BM", "KY", "DM", "DO", "GD", "GU", "JM", "MS", "MP", "KN", "LC", "VC", "TT", "TC"]
|
|
61
|
+
ItuCodes.iso2itu('US')
|
|
62
|
+
# => "1"
|
|
49
63
|
|
|
50
64
|
# Mexico
|
|
51
65
|
# ISO 3361 code : MX
|
|
52
66
|
# ITU code : 52
|
|
53
|
-
ItuCodes.iso2itu('MX')
|
|
67
|
+
ItuCodes.iso2itu('MX')
|
|
68
|
+
# => "52"
|
|
54
69
|
|
|
55
|
-
# Georgia
|
|
56
|
-
# ISO 3361 code : GE
|
|
57
|
-
# ITU code : 995
|
|
58
|
-
ItuCodes.itu2iso('995') # => ["GE"]
|
|
59
70
|
|
|
60
|
-
[1]: http://www.itu.int/
|
|
61
|
-
[2]: http://www.itu.int/dms_pub/itu-t/opb/sp/T-SP-E.164D-11-2011-PDF-E.pdf
|
|
71
|
+
[1]: http://www.itu.int/pub/T-SP-E.164D-11-2011
|
|
72
|
+
[2]: http://www.itu.int/dms_pub/itu-t/opb/sp/T-SP-E.164D-11-2011-PDF-E.pdf
|
|
73
|
+
[3]: http://www.iso.org/iso/home/standards/country_codes
|
|
74
|
+
[4]: http://www.iso.org/iso/home/standards/country_codes/country_names_and_code_elements_xml
|
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
---
|
|
2
|
+
# Data compiled from PDF document provided by ITU
|
|
3
|
+
# See:
|
|
4
|
+
# * http://www.itu.int/pub/T-SP-E.164D-11-2011
|
|
5
|
+
# * vendor/itu/T-SP-E.164D-11-2011-PDF-E.pdf
|
|
6
|
+
|
|
7
|
+
'0': Reserved
|
|
8
|
+
'1':
|
|
9
|
+
- American Samoa
|
|
10
|
+
- Anguilla
|
|
11
|
+
- Antigua and Barbuda
|
|
12
|
+
- Bahamas (Commonwealth of the)
|
|
13
|
+
- Barbados
|
|
14
|
+
- Bermuda
|
|
15
|
+
- British Virgin Islands
|
|
16
|
+
- Canada
|
|
17
|
+
- Cayman Islands
|
|
18
|
+
- Dominica (Commonwealth of)
|
|
19
|
+
- Dominican Republic
|
|
20
|
+
- Grenada
|
|
21
|
+
- Guam
|
|
22
|
+
- Jamaica
|
|
23
|
+
- Montserrat
|
|
24
|
+
- Northern Mariana Islands (Commonwealth of the)
|
|
25
|
+
- Puerto Rico
|
|
26
|
+
- Saint Kitts and Nevis
|
|
27
|
+
- Saint Lucia
|
|
28
|
+
- Saint Vincent and the Grenadines
|
|
29
|
+
- Sint Maarten (Dutch part)
|
|
30
|
+
- Trinidad and Tobago
|
|
31
|
+
- Turks and Caicos Islands
|
|
32
|
+
- United States of America
|
|
33
|
+
- United States Virgin Islands
|
|
34
|
+
'20': Egypt (Arab Republic of)
|
|
35
|
+
'210': Spare code
|
|
36
|
+
'211': South Sudan (Republic of)
|
|
37
|
+
'212': Morocco (Kingdom of)
|
|
38
|
+
'213': Algeria (People's Democratic Republic of)
|
|
39
|
+
'214': Spare code
|
|
40
|
+
'215': Spare code
|
|
41
|
+
'216': Tunisia
|
|
42
|
+
'217': Spare code
|
|
43
|
+
'218': Libya (Socialist People's Libyan Arab Jamahiriya)
|
|
44
|
+
'219': Spare code
|
|
45
|
+
'220': Gambia (Republic of the)
|
|
46
|
+
'221': Senegal (Republic of)
|
|
47
|
+
'222': Mauritania (Islamic Republic of)
|
|
48
|
+
'223': Mali (Republic of)
|
|
49
|
+
'224': Guinea (Republic of)
|
|
50
|
+
'225': Côte d'Ivoire (Republic of)
|
|
51
|
+
'226': Burkina Faso
|
|
52
|
+
'227': Niger (Republic of the)
|
|
53
|
+
'228': Togolese Republic
|
|
54
|
+
'229': Benin (Republic of)
|
|
55
|
+
'230': Mauritius (Republic of)
|
|
56
|
+
'231': Liberia (Republic of)
|
|
57
|
+
'232': Sierra Leone
|
|
58
|
+
'233': Ghana
|
|
59
|
+
'234': Nigeria (Federal Republic of)
|
|
60
|
+
'235': Chad (Republic of)
|
|
61
|
+
'236': Central African Republic
|
|
62
|
+
'237': Cameroon (Republic of)
|
|
63
|
+
'238': Cape Verde (Republic of)
|
|
64
|
+
'239': Sao Tome and Principe (Democratic Republic of)
|
|
65
|
+
'240': Equatorial Guinea (Republic of)
|
|
66
|
+
'241': Gabonese Republic
|
|
67
|
+
'242': Congo (Republic of the)
|
|
68
|
+
'243': Democratic Republic of the Congo
|
|
69
|
+
'244': Angola (Republic of)
|
|
70
|
+
'245': Guinea-Bissau (Republic of)
|
|
71
|
+
'246': Diego Garcia
|
|
72
|
+
'247': Saint Helena, Ascension and Tristan da Cunha
|
|
73
|
+
'248': Seychelles (Republic of)
|
|
74
|
+
'249': Sudan (Republic of the)
|
|
75
|
+
'250': Rwanda (Republic of)
|
|
76
|
+
'251': Ethiopia (Federal Democratic Republic of)
|
|
77
|
+
'252': Somali Democratic Republic
|
|
78
|
+
'253': Djibouti (Republic of)
|
|
79
|
+
'254': Kenya (Republic of)
|
|
80
|
+
'255': Tanzania (United Republic of)
|
|
81
|
+
'256': Uganda (Republic of)
|
|
82
|
+
'257': Burundi (Republic of)
|
|
83
|
+
'258': Mozambique (Republic of)
|
|
84
|
+
'259': Spare code
|
|
85
|
+
'260': Zambia (Republic of)
|
|
86
|
+
'261': Madagascar (Republic of)
|
|
87
|
+
'262': French Departments and Territories in the Indian Ocean
|
|
88
|
+
'263': Zimbabwe (Republic of)
|
|
89
|
+
'264': Namibia (Republic of)
|
|
90
|
+
'265': Malawi
|
|
91
|
+
'266': Lesotho (Kingdom of)
|
|
92
|
+
'267': Botswana (Republic of)
|
|
93
|
+
'268': Swaziland (Kingdom of)
|
|
94
|
+
'269': Comoros (Union of the)
|
|
95
|
+
'27': South Africa (Republic of)
|
|
96
|
+
'280': Spare code
|
|
97
|
+
'281': Spare code
|
|
98
|
+
'282': Spare code
|
|
99
|
+
'283': Spare code
|
|
100
|
+
'284': Spare code
|
|
101
|
+
'285': Spare code
|
|
102
|
+
'286': Spare code
|
|
103
|
+
'287': Spare code
|
|
104
|
+
'288': Spare code
|
|
105
|
+
'289': Spare code
|
|
106
|
+
'290': Saint Helena, Ascension and Tristan da Cunha
|
|
107
|
+
'291': Eritrea
|
|
108
|
+
'292': Spare code
|
|
109
|
+
'293': Spare code
|
|
110
|
+
'294': Spare code
|
|
111
|
+
'295': Spare code
|
|
112
|
+
'296': Spare code
|
|
113
|
+
'297': Aruba
|
|
114
|
+
'298': Faroe Islands
|
|
115
|
+
'299': Greenland (Denmark)
|
|
116
|
+
'30': Greece
|
|
117
|
+
'31': Netherlands (Kingdom of the)
|
|
118
|
+
'32': Belgium
|
|
119
|
+
'33': France
|
|
120
|
+
'34': Spain
|
|
121
|
+
'350': Gibraltar
|
|
122
|
+
'351': Portugal
|
|
123
|
+
'352': Luxembourg
|
|
124
|
+
'353': Ireland
|
|
125
|
+
'354': Iceland
|
|
126
|
+
'355': Albania (Republic of)
|
|
127
|
+
'356': Malta
|
|
128
|
+
'357': Cyprus (Republic of)
|
|
129
|
+
'358': Finland
|
|
130
|
+
'359': Bulgaria (Republic of)
|
|
131
|
+
'36': Hungary (Republic of)
|
|
132
|
+
'370': Lithuania (Republic of)
|
|
133
|
+
'371': Latvia (Republic of)
|
|
134
|
+
'372': Estonia (Republic of)
|
|
135
|
+
'373': Moldova (Republic of)
|
|
136
|
+
'374': Armenia (Republic of)
|
|
137
|
+
'375': Belarus (Republic of)
|
|
138
|
+
'376': Andorra (Principality of)
|
|
139
|
+
'377': Monaco (Principality of)
|
|
140
|
+
'378': San Marino (Republic of)
|
|
141
|
+
'379': Vatican City State
|
|
142
|
+
'380': Ukraine
|
|
143
|
+
'381': Serbia (Republic of)
|
|
144
|
+
'382': Montenegro (Republic of)
|
|
145
|
+
'383': Spare code
|
|
146
|
+
'384': Spare code
|
|
147
|
+
'385': Croatia (Republic of)
|
|
148
|
+
'386': Slovenia (Republic of)
|
|
149
|
+
'387': Bosnia and Herzegovina
|
|
150
|
+
'388': Group of countries, shared code
|
|
151
|
+
'389': The Former Yugoslav Republic of Macedonia
|
|
152
|
+
'39':
|
|
153
|
+
- Italy
|
|
154
|
+
- Vatican City State
|
|
155
|
+
'40': Romania
|
|
156
|
+
'41': Switzerland (Confederation of)
|
|
157
|
+
'420': Czech Republic
|
|
158
|
+
'421': Slovak Republic
|
|
159
|
+
'422': Spare code
|
|
160
|
+
'423': Liechtenstein (Principality of)
|
|
161
|
+
'424': Spare code
|
|
162
|
+
'425': Spare code
|
|
163
|
+
'426': Spare code
|
|
164
|
+
'427': Spare code
|
|
165
|
+
'428': Spare code
|
|
166
|
+
'429': Spare code
|
|
167
|
+
'43': Austria
|
|
168
|
+
'44': United Kingdom of Great Britain and Northern Ireland
|
|
169
|
+
'45': Denmark
|
|
170
|
+
'46': Sweden
|
|
171
|
+
'47': Norway
|
|
172
|
+
'48': Poland (Republic of)
|
|
173
|
+
'49': Germany (Federal Republic of)
|
|
174
|
+
'500': Falkland Islands (Malvinas)
|
|
175
|
+
'501': Belize
|
|
176
|
+
'502': Guatemala (Republic of)
|
|
177
|
+
'503': El Salvador (Republic of)
|
|
178
|
+
'504': Honduras (Republic of)
|
|
179
|
+
'505': Nicaragua
|
|
180
|
+
'506': Costa Rica
|
|
181
|
+
'507': Panama (Republic of)
|
|
182
|
+
'508': Saint Pierre and Miquelon (Collectivité territoriale de la République française)
|
|
183
|
+
'509': Haiti (Republic of)
|
|
184
|
+
'51': Peru
|
|
185
|
+
'52': Mexico
|
|
186
|
+
'53': Cuba
|
|
187
|
+
'54': Argentine Republic
|
|
188
|
+
'55': Brazil (Federative Republic of)
|
|
189
|
+
'56': Chile
|
|
190
|
+
'57': Colombia (Republic of)
|
|
191
|
+
'58': Venezuela (Bolivarian Republic of)
|
|
192
|
+
'590': Guadeloupe (French Department of)
|
|
193
|
+
'591': Bolivia (Plurinational State of)
|
|
194
|
+
'592': Guyana
|
|
195
|
+
'593': Ecuador
|
|
196
|
+
'594': French Guiana (French Department of)
|
|
197
|
+
'595': Paraguay (Republic of)
|
|
198
|
+
'596': Martinique (French Department of)
|
|
199
|
+
'597': Suriname (Republic of)
|
|
200
|
+
'598': Uruguay (Eastern Republic of)
|
|
201
|
+
'599':
|
|
202
|
+
- Bonaire, Saint Eustatius and Saba
|
|
203
|
+
- Curaçao
|
|
204
|
+
'60': Malaysia
|
|
205
|
+
'61': Australia
|
|
206
|
+
'62': Indonesia (Republic of)
|
|
207
|
+
'63': Philippines (Republic of the)
|
|
208
|
+
'64': New Zealand
|
|
209
|
+
'65': Singapore (Republic of)
|
|
210
|
+
'66': Thailand
|
|
211
|
+
'670': Democratic Republic of Timor-Leste
|
|
212
|
+
'671': Spare code
|
|
213
|
+
'672': Australian External Territories
|
|
214
|
+
'673': Brunei Darussalam
|
|
215
|
+
'674': Nauru (Republic of)
|
|
216
|
+
'675': Papua New Guinea
|
|
217
|
+
'676': Tonga (Kingdom of)
|
|
218
|
+
'677': Solomon Islands
|
|
219
|
+
'678': Vanuatu (Republic of)
|
|
220
|
+
'679': Fiji (Republic of)
|
|
221
|
+
'680': Palau (Republic of)
|
|
222
|
+
'681': Wallis and Futuna (Territoire français d'outre-mer)
|
|
223
|
+
'682': Cook Islands
|
|
224
|
+
'683': Niue
|
|
225
|
+
'684': Spare code
|
|
226
|
+
'685': Samoa (Independent State of)
|
|
227
|
+
'686': Kiribati (Republic of)
|
|
228
|
+
'687': New Caledonia (Territoire français d'outre-mer)
|
|
229
|
+
'688': Tuvalu
|
|
230
|
+
'689': French Polynesia (Territoire français d'outre-mer)
|
|
231
|
+
'690': Tokelau
|
|
232
|
+
'691': Micronesia (Federated States of)
|
|
233
|
+
'692': Marshall Islands (Republic of the)
|
|
234
|
+
'693': Spare code
|
|
235
|
+
'694': Spare code
|
|
236
|
+
'695': Spare code
|
|
237
|
+
'696': Spare code
|
|
238
|
+
'697': Spare code
|
|
239
|
+
'698': Spare code
|
|
240
|
+
'699': Spare code
|
|
241
|
+
'7':
|
|
242
|
+
- Kazakhstan (Republic of)
|
|
243
|
+
- Russian Federation
|
|
244
|
+
'800': International Freephone Service
|
|
245
|
+
'801': Spare code
|
|
246
|
+
'802': Spare code
|
|
247
|
+
'803': Spare code
|
|
248
|
+
'804': Spare code
|
|
249
|
+
'805': Spare code
|
|
250
|
+
'806': Spare code
|
|
251
|
+
'807': Spare code
|
|
252
|
+
'808': International Shared Cost Service (ISCS)
|
|
253
|
+
'809': Spare code
|
|
254
|
+
'81': Japan
|
|
255
|
+
'82': Korea (Republic of)
|
|
256
|
+
'830': Spare code
|
|
257
|
+
'831': Spare code
|
|
258
|
+
'832': Spare code
|
|
259
|
+
'833': Spare code
|
|
260
|
+
'834': Spare code
|
|
261
|
+
'835': Spare code
|
|
262
|
+
'836': Spare code
|
|
263
|
+
'837': Spare code
|
|
264
|
+
'838': Spare code
|
|
265
|
+
'839': Spare code
|
|
266
|
+
'84': Viet Nam (Socialist Republic of)
|
|
267
|
+
'850': Democratic People's Republic of Korea
|
|
268
|
+
'851': Spare code
|
|
269
|
+
'852': Hong Kong, China
|
|
270
|
+
'853': Macao, China
|
|
271
|
+
'854': Spare code
|
|
272
|
+
'855': Cambodia (Kingdom of)
|
|
273
|
+
'856': Lao People's Democratic Republic
|
|
274
|
+
'857': Spare code
|
|
275
|
+
'858': Spare code
|
|
276
|
+
'859': Spare code
|
|
277
|
+
'86': China (People's Republic of)
|
|
278
|
+
'870': Inmarsat SNAC
|
|
279
|
+
'871': Spare code
|
|
280
|
+
'872': Spare code
|
|
281
|
+
'873': Spare code
|
|
282
|
+
'874': Spare code
|
|
283
|
+
'875': Reserved - Maritime Mobile Service Applications
|
|
284
|
+
'876': Reserved - Maritime Mobile Service Applications
|
|
285
|
+
'877': Reserved - Maritime Mobile Service Applications
|
|
286
|
+
'878': Universal Personal Telecommunication Service (UPT)
|
|
287
|
+
'879': Reserved for national non-commercial purposes
|
|
288
|
+
'880': Bangladesh (People's Republic of)
|
|
289
|
+
'881': Global Mobile Satellite System (GMSS), shared code
|
|
290
|
+
'882': International Networks, shared code
|
|
291
|
+
'883': International Networks, shared code
|
|
292
|
+
'884': Spare code
|
|
293
|
+
'885': Spare code
|
|
294
|
+
'886': Taiwan, China
|
|
295
|
+
'887': Spare code
|
|
296
|
+
'888': Telecommunications for Disaster Relief (TDR)
|
|
297
|
+
'889': Spare code
|
|
298
|
+
'890': Spare code
|
|
299
|
+
'891': Spare code
|
|
300
|
+
'892': Spare code
|
|
301
|
+
'893': Spare code
|
|
302
|
+
'894': Spare code
|
|
303
|
+
'895': Spare code
|
|
304
|
+
'896': Spare code
|
|
305
|
+
'897': Spare code
|
|
306
|
+
'898': Spare code
|
|
307
|
+
'899': Spare code
|
|
308
|
+
'90': Turkey
|
|
309
|
+
'91': India (Republic of)
|
|
310
|
+
'92': Pakistan (Islamic Republic of)
|
|
311
|
+
'93': Afghanistan
|
|
312
|
+
'94': Sri Lanka (Democratic Socialist Republic of)
|
|
313
|
+
'95': Myanmar (the Republic of the Union of)
|
|
314
|
+
'960': Maldives (Republic of)
|
|
315
|
+
'961': Lebanon
|
|
316
|
+
'962': Jordan (Hashemite Kingdom of)
|
|
317
|
+
'963': Syrian Arab Republic
|
|
318
|
+
'964': Iraq (Republic of)
|
|
319
|
+
'965': Kuwait (State of)
|
|
320
|
+
'966': Saudi Arabia (Kingdom of)
|
|
321
|
+
'967': Yemen (Republic of)
|
|
322
|
+
'968': Oman (Sultanate of)
|
|
323
|
+
'969': Reserved - reservation currently under investigation
|
|
324
|
+
'970': Reserved
|
|
325
|
+
'971': United Arab Emirates
|
|
326
|
+
'972': Israel (State of)
|
|
327
|
+
'973': Bahrain (Kingdom of)
|
|
328
|
+
'974': Qatar (State of)
|
|
329
|
+
'975': Bhutan (Kingdom of)
|
|
330
|
+
'976': Mongolia
|
|
331
|
+
'977': Nepal (Federal Democratic Republic of)
|
|
332
|
+
'978': Spare code
|
|
333
|
+
'979': International Premium Rate Service (IPRS)
|
|
334
|
+
'98': Iran (Islamic Republic of)
|
|
335
|
+
'990': Spare code
|
|
336
|
+
'991': Trial of a proposed new international telecommunication public correspondence
|
|
337
|
+
service, shared code
|
|
338
|
+
'992': Tajikistan (Republic of)
|
|
339
|
+
'993': Turkmenistan
|
|
340
|
+
'994': Azerbaijani Republic
|
|
341
|
+
'995': Georgia
|
|
342
|
+
'996': Kyrgyz Republic
|
|
343
|
+
'997': Spare code
|
|
344
|
+
'998': Uzbekistan (Republic of)
|
|
345
|
+
'999': Reserved for future global service
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
---
|
|
2
|
+
# The names of territories used by the ITU do not match exactly
|
|
3
|
+
# the names used by the ISO, so a dictionary is required to map
|
|
4
|
+
# ISO 3166-1 two-letter codes to the territory names used by ITU
|
|
5
|
+
|
|
6
|
+
# Data compiled from XML file provided by ISO and PDF document
|
|
7
|
+
# provided by ITU
|
|
8
|
+
# See:
|
|
9
|
+
# * http://www.iso.org/iso/home/standards/country_codes
|
|
10
|
+
# * vendor/iso/country_names_and_code_elements_xml.xml
|
|
11
|
+
#
|
|
12
|
+
# * http://www.itu.int/pub/T-SP-E.164D-11-2011
|
|
13
|
+
# * vendor/itu/T-SP-E.164D-11-2011-PDF-E.pdf
|
|
14
|
+
|
|
15
|
+
# The following 3 names used by the ITU do not have an ISO-3166-1
|
|
16
|
+
# 2 letter code:
|
|
17
|
+
#
|
|
18
|
+
# - Diego Garcia
|
|
19
|
+
# - French Departments and Territories in the Indian Ocean
|
|
20
|
+
# - Australian External Territories
|
|
21
|
+
|
|
22
|
+
AD: Andorra (Principality of)
|
|
23
|
+
AE: United Arab Emirates
|
|
24
|
+
AF: Afghanistan
|
|
25
|
+
AG: Antigua and Barbuda
|
|
26
|
+
AI: Anguilla
|
|
27
|
+
AL: Albania (Republic of)
|
|
28
|
+
AM: Armenia (Republic of)
|
|
29
|
+
AO: Angola (Republic of)
|
|
30
|
+
AR: Argentine Republic
|
|
31
|
+
AS: American Samoa
|
|
32
|
+
AT: Austria
|
|
33
|
+
AU: Australia
|
|
34
|
+
AW: Aruba
|
|
35
|
+
AZ: Azerbaijani Republic
|
|
36
|
+
BA: Bosnia and Herzegovina
|
|
37
|
+
BB: Barbados
|
|
38
|
+
BD: Bangladesh (People's Republic of)
|
|
39
|
+
BE: Belgium
|
|
40
|
+
BF: Burkina Faso
|
|
41
|
+
BG: Bulgaria (Republic of)
|
|
42
|
+
BH: Bahrain (Kingdom of)
|
|
43
|
+
BI: Burundi (Republic of)
|
|
44
|
+
BJ: Benin (Republic of)
|
|
45
|
+
BM: Bermuda
|
|
46
|
+
BN: Brunei Darussalam
|
|
47
|
+
BO: Bolivia (Plurinational State of)
|
|
48
|
+
BQ: Bonaire, Saint Eustatius and Saba
|
|
49
|
+
BR: Brazil (Federative Republic of)
|
|
50
|
+
BS: Bahamas (Commonwealth of the)
|
|
51
|
+
BT: Bhutan (Kingdom of)
|
|
52
|
+
BW: Botswana (Republic of)
|
|
53
|
+
BY: Belarus (Republic of)
|
|
54
|
+
BZ: Belize
|
|
55
|
+
CA: Canada
|
|
56
|
+
CD: Democratic Republic of the Congo
|
|
57
|
+
CF: Central African Republic
|
|
58
|
+
CG: Congo (Republic of the)
|
|
59
|
+
CH: Switzerland (Confederation of)
|
|
60
|
+
CI: Côte d'Ivoire (Republic of)
|
|
61
|
+
CK: Cook Islands
|
|
62
|
+
CL: Chile
|
|
63
|
+
CM: Cameroon (Republic of)
|
|
64
|
+
CN: China (People's Republic of)
|
|
65
|
+
CO: Colombia (Republic of)
|
|
66
|
+
CR: Costa Rica
|
|
67
|
+
CU: Cuba
|
|
68
|
+
CV: Cape Verde (Republic of)
|
|
69
|
+
CW: Curaçao
|
|
70
|
+
CY: Cyprus (Republic of)
|
|
71
|
+
CZ: Czech Republic
|
|
72
|
+
DE: Germany (Federal Republic of)
|
|
73
|
+
DJ: Djibouti (Republic of)
|
|
74
|
+
DK: Denmark
|
|
75
|
+
DM: Dominica (Commonwealth of)
|
|
76
|
+
DO: Dominican Republic
|
|
77
|
+
DZ: Algeria (People's Democratic Republic of)
|
|
78
|
+
EC: Ecuador
|
|
79
|
+
EE: Estonia (Republic of)
|
|
80
|
+
EG: Egypt (Arab Republic of)
|
|
81
|
+
ER: Eritrea
|
|
82
|
+
ES: Spain
|
|
83
|
+
ET: Ethiopia (Federal Democratic Republic of)
|
|
84
|
+
FI: Finland
|
|
85
|
+
FJ: Fiji (Republic of)
|
|
86
|
+
FK: Falkland Islands (Malvinas)
|
|
87
|
+
FM: Micronesia (Federated States of)
|
|
88
|
+
FO: Faroe Islands
|
|
89
|
+
FR: France
|
|
90
|
+
GA: Gabonese Republic
|
|
91
|
+
GB: United Kingdom of Great Britain and Northern Ireland
|
|
92
|
+
GD: Grenada
|
|
93
|
+
GE: Georgia
|
|
94
|
+
GF: French Guiana (French Department of)
|
|
95
|
+
GH: Ghana
|
|
96
|
+
GI: Gibraltar
|
|
97
|
+
GL: Greenland (Denmark)
|
|
98
|
+
GM: Gambia (Republic of the)
|
|
99
|
+
GN: Guinea (Republic of)
|
|
100
|
+
GP: Guadeloupe (French Department of)
|
|
101
|
+
GQ: Equatorial Guinea (Republic of)
|
|
102
|
+
GR: Greece
|
|
103
|
+
GT: Guatemala (Republic of)
|
|
104
|
+
GU: Guam
|
|
105
|
+
GW: Guinea-Bissau (Republic of)
|
|
106
|
+
GY: Guyana
|
|
107
|
+
HK: Hong Kong, China
|
|
108
|
+
HN: Honduras (Republic of)
|
|
109
|
+
HR: Croatia (Republic of)
|
|
110
|
+
HT: Haiti (Republic of)
|
|
111
|
+
HU: Hungary (Republic of)
|
|
112
|
+
ID: Indonesia (Republic of)
|
|
113
|
+
IE: Ireland
|
|
114
|
+
IL: Israel (State of)
|
|
115
|
+
IN: India (Republic of)
|
|
116
|
+
IQ: Iraq (Republic of)
|
|
117
|
+
IR: Iran (Islamic Republic of)
|
|
118
|
+
IS: Iceland
|
|
119
|
+
IT: Italy
|
|
120
|
+
JM: Jamaica
|
|
121
|
+
JO: Jordan (Hashemite Kingdom of)
|
|
122
|
+
JP: Japan
|
|
123
|
+
KE: Kenya (Republic of)
|
|
124
|
+
KG: Kyrgyz Republic
|
|
125
|
+
KH: Cambodia (Kingdom of)
|
|
126
|
+
KI: Kiribati (Republic of)
|
|
127
|
+
KM: Comoros (Union of the)
|
|
128
|
+
KN: Saint Kitts and Nevis
|
|
129
|
+
KP: Democratic People's Republic of Korea
|
|
130
|
+
KR: Korea (Republic of)
|
|
131
|
+
KW: Kuwait (State of)
|
|
132
|
+
KY: Cayman Islands
|
|
133
|
+
KZ: Kazakhstan (Republic of)
|
|
134
|
+
LA: Lao People's Democratic Republic
|
|
135
|
+
LB: Lebanon
|
|
136
|
+
LC: Saint Lucia
|
|
137
|
+
LI: Liechtenstein (Principality of)
|
|
138
|
+
LK: Sri Lanka (Democratic Socialist Republic of)
|
|
139
|
+
LR: Liberia (Republic of)
|
|
140
|
+
LS: Lesotho (Kingdom of)
|
|
141
|
+
LT: Lithuania (Republic of)
|
|
142
|
+
LU: Luxembourg
|
|
143
|
+
LV: Latvia (Republic of)
|
|
144
|
+
LY: Libya (Socialist People's Libyan Arab Jamahiriya)
|
|
145
|
+
MA: Morocco (Kingdom of)
|
|
146
|
+
MC: Monaco (Principality of)
|
|
147
|
+
MD: Moldova (Republic of)
|
|
148
|
+
ME: Montenegro (Republic of)
|
|
149
|
+
MG: Madagascar (Republic of)
|
|
150
|
+
MH: Marshall Islands (Republic of the)
|
|
151
|
+
MK: The Former Yugoslav Republic of Macedonia
|
|
152
|
+
ML: Mali (Republic of)
|
|
153
|
+
MM: Myanmar (the Republic of the Union of)
|
|
154
|
+
MN: Mongolia
|
|
155
|
+
MO: Macao, China
|
|
156
|
+
MP: Northern Mariana Islands (Commonwealth of the)
|
|
157
|
+
MQ: Martinique (French Department of)
|
|
158
|
+
MR: Mauritania (Islamic Republic of)
|
|
159
|
+
MS: Montserrat
|
|
160
|
+
MT: Malta
|
|
161
|
+
MU: Mauritius (Republic of)
|
|
162
|
+
MV: Maldives (Republic of)
|
|
163
|
+
MW: Malawi
|
|
164
|
+
MX: Mexico
|
|
165
|
+
MY: Malaysia
|
|
166
|
+
MZ: Mozambique (Republic of)
|
|
167
|
+
NA: Namibia (Republic of)
|
|
168
|
+
NC: New Caledonia (Territoire français d'outre-mer)
|
|
169
|
+
NE: Niger (Republic of the)
|
|
170
|
+
NG: Nigeria (Federal Republic of)
|
|
171
|
+
NI: Nicaragua
|
|
172
|
+
NL: Netherlands (Kingdom of the)
|
|
173
|
+
'NO': Norway
|
|
174
|
+
NP: Nepal (Federal Democratic Republic of)
|
|
175
|
+
NR: Nauru (Republic of)
|
|
176
|
+
NU: Niue
|
|
177
|
+
NZ: New Zealand
|
|
178
|
+
OM: Oman (Sultanate of)
|
|
179
|
+
PA: Panama (Republic of)
|
|
180
|
+
PE: Peru
|
|
181
|
+
PF: French Polynesia (Territoire français d'outre-mer)
|
|
182
|
+
PG: Papua New Guinea
|
|
183
|
+
PH: Philippines (Republic of the)
|
|
184
|
+
PK: Pakistan (Islamic Republic of)
|
|
185
|
+
PL: Poland (Republic of)
|
|
186
|
+
PM: Saint Pierre and Miquelon (Collectivité territoriale de la République française)
|
|
187
|
+
PR: Puerto Rico
|
|
188
|
+
PT: Portugal
|
|
189
|
+
PW: Palau (Republic of)
|
|
190
|
+
PY: Paraguay (Republic of)
|
|
191
|
+
QA: Qatar (State of)
|
|
192
|
+
RO: Romania
|
|
193
|
+
RS: Serbia (Republic of)
|
|
194
|
+
RU: Russian Federation
|
|
195
|
+
RW: Rwanda (Republic of)
|
|
196
|
+
SA: Saudi Arabia (Kingdom of)
|
|
197
|
+
SB: Solomon Islands
|
|
198
|
+
SC: Seychelles (Republic of)
|
|
199
|
+
SD: Sudan (Republic of the)
|
|
200
|
+
SE: Sweden
|
|
201
|
+
SG: Singapore (Republic of)
|
|
202
|
+
SH: Saint Helena, Ascension and Tristan da Cunha
|
|
203
|
+
SI: Slovenia (Republic of)
|
|
204
|
+
SK: Slovak Republic
|
|
205
|
+
SL: Sierra Leone
|
|
206
|
+
SM: San Marino (Republic of)
|
|
207
|
+
SN: Senegal (Republic of)
|
|
208
|
+
SO: Somali Democratic Republic
|
|
209
|
+
SR: Suriname (Republic of)
|
|
210
|
+
SS: South Sudan (Republic of)
|
|
211
|
+
ST: Sao Tome and Principe (Democratic Republic of)
|
|
212
|
+
SV: El Salvador (Republic of)
|
|
213
|
+
SX: Sint Maarten (Dutch part)
|
|
214
|
+
SY: Syrian Arab Republic
|
|
215
|
+
SZ: Swaziland (Kingdom of)
|
|
216
|
+
TC: Turks and Caicos Islands
|
|
217
|
+
TD: Chad (Republic of)
|
|
218
|
+
TG: Togolese Republic
|
|
219
|
+
TH: Thailand
|
|
220
|
+
TJ: Tajikistan (Republic of)
|
|
221
|
+
TK: Tokelau
|
|
222
|
+
TL: Democratic Republic of Timor-Leste
|
|
223
|
+
TM: Turkmenistan
|
|
224
|
+
TN: Tunisia
|
|
225
|
+
TO: Tonga (Kingdom of)
|
|
226
|
+
TR: Turkey
|
|
227
|
+
TT: Trinidad and Tobago
|
|
228
|
+
TV: Tuvalu
|
|
229
|
+
TW: Taiwan, China
|
|
230
|
+
TZ: Tanzania (United Republic of)
|
|
231
|
+
UA: Ukraine
|
|
232
|
+
UG: Uganda (Republic of)
|
|
233
|
+
US: United States of America
|
|
234
|
+
UY: Uruguay (Eastern Republic of)
|
|
235
|
+
UZ: Uzbekistan (Republic of)
|
|
236
|
+
VA: Vatican City State
|
|
237
|
+
VC: Saint Vincent and the Grenadines
|
|
238
|
+
VE: Venezuela (Bolivarian Republic of)
|
|
239
|
+
VG: British Virgin Islands
|
|
240
|
+
VI: United States Virgin Islands
|
|
241
|
+
VN: Viet Nam (Socialist Republic of)
|
|
242
|
+
VU: Vanuatu (Republic of)
|
|
243
|
+
WF: Wallis and Futuna (Territoire français d'outre-mer)
|
|
244
|
+
WS: Samoa (Independent State of)
|
|
245
|
+
YE: Yemen (Republic of)
|
|
246
|
+
ZA: South Africa (Republic of)
|
|
247
|
+
ZM: Zambia (Republic of)
|
|
248
|
+
ZW: Zimbabwe (Republic of)
|