views:

1043

answers:

2

On this Wikipedia entry I found out that ITU Telecommunication Standardization Sector (ITU-T) is providing such list of country calling codes.

Here is a pdf: http://www.itu.int/dms_pub/itu-t/opb/sp/T-SP-E.164D-2009-PDF-E.pdf

I wonder where to find this in a xml file or similar? I need to do find out which country a phone number is from, both in javascript and c#.

A: 

I copy-pasted the whole pdf in a text editor and got something like:

...
31 Netherlands (Kingdom of the)  
32 Belgium  
33 France  
34 Spain  
350 Gibraltar  
351 Portugal  
352 Luxembourg  
353 Ireland  
354 Iceland
...

You could easily parse this to create a xml :)

Klaus
Yes that could work but I hope I can found a list where somebody already done it. Must exist somewhere.And also I would like to have the country codes and not the full names, like this:31 UK32 BE33 FR
jesperlind
+1  A: 

There is an Excel file with regexps (here). You can easily "convert" it to XML and you will be able to determine country by the full phone number.

Artyom Sokolov
Thank you, this is great. Regex are a nice bonus. Gonna try to use them to validate.
jesperlind