Theia installation has been updated - September 10, 2011
« May 2013
S M T W T F S
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  
Theia
International telephone country codes (in XML format using ISO 639-1) « home
icon
posted on 22:18 - 09 July 2010 | posted by Lev
First off a little introduction is in order to the scenario I was in, because I am sure someone else out there will eventually be in a similar situation.
 
I am working on developing a system for a client which involves sending a validation code to a user's mobile phone in the form of an SMS. Because we wanted to avoid the whole hassle of forcing the user to include their country code in the prefix of their mobile number (since let's face it, most of us probably don't know it unless we've made international calls before), the idea was to simply determine this based on the country the user lives in.
 
Now because I always store the user's country in the database in the IS0 639-1 specification, I needed to have an XML file which basically had a simple structure of the countries code as the tag, and the calling code as the value.
 
I searched around for a while and didn't find any, so I decided that I was just going to instead look for a site that had the 2 letter country code and the international calling code both in a well structured manner which I could scrape from. Thus, I built a small data-mining/scraping script which pulled in all the data, used some regular expressions to interpret it and discard all the HTML and low and behold, here is the result:
 
XML CODE
<?xml version='1.0' encoding='UTF-8'?>
<icc>
    <AF>93</AF>
    <AL>355</AL>
    <DZ>213</DZ>
    <AD>376</AD>
    <AO>244</AO>
    <AQ>672</AQ>
    <AR>54</AR>
    <AM>374</AM>
    <AW>297</AW>
    <AU>61</AU>
    <AT>43</AT>
    <AZ>994</AZ>
    <BH>973</BH>
    <BD>880</BD>
    <BY>375</BY>
    <BE>32</BE>
    <BZ>501</BZ>
    <BJ>229</BJ>
    <BT>975</BT>
    <BO>591</BO>
    <BA>387</BA>
    <BW>267</BW>
    <BR>55</BR>
    <BN>673</BN>
    <BG>359</BG>
    <BF>226</BF>
    <MM>95</MM>
    <BI>257</BI>
    <KH>855</KH>
    <CM>237</CM>
    <CA>1</CA>
    <CV>238</CV>
    <CF>236</CF>
    <TD>235</TD>
    <CL>56</CL>
    <CN>86</CN>
    <CX>61</CX>
    <CC>61</CC>
    <CO>57</CO>
    <KM>269</KM>
    <CG>242</CG>
    <CD>243</CD>
    <CK>682</CK>
    <CR>506</CR>
    <HR>385</HR>
    <CU>53</CU>
    <CY>357</CY>
    <CZ>420</CZ>
    <DK>45</DK>
    <DJ>253</DJ>
    <TL>670</TL>
    <EC>593</EC>
    <EG>20</EG>
    <SV>503</SV>
    <GQ>240</GQ>
    <ER>291</ER>
    <EE>372</EE>
    <ET>251</ET>
    <FK>500</FK>
    <FO>298</FO>
    <FJ>679</FJ>
    <FI>358</FI>
    <FR>33</FR>
    <PF>689</PF>
    <GA>241</GA>
    <GM>220</GM>
    <GE>995</GE>
    <DE>49</DE>
    <GH>233</GH>
    <GI>350</GI>
    <GR>30</GR>
    <GL>299</GL>
    <GT>502</GT>
    <GN>224</GN>
    <GW>245</GW>
    <GY>592</GY>
    <HT>509</HT>
    <HN>504</HN>
    <HK>852</HK>
    <HU>36</HU>
    <IN>91</IN>
    <ID>62</ID>
    <IR>98</IR>
    <IQ>964</IQ>
    <IE>353</IE>
    <IM>44</IM>
    <IL>972</IL>
    <IT>39</IT>
    <CI>225</CI>
    <JP>81</JP>
    <JO>962</JO>
    <KZ>7</KZ>
    <KE>254</KE>
    <KI>686</KI>
    <KW>965</KW>
    <KG>996</KG>
    <LA>856</LA>
    <LV>371</LV>
    <LB>961</LB>
    <LS>266</LS>
    <LR>231</LR>
    <LY>218</LY>
    <LI>423</LI>
    <LT>370</LT>
    <LU>352</LU>
    <MO>853</MO>
    <MK>389</MK>
    <MG>261</MG>
    <MW>265</MW>
    <MY>60</MY>
    <MV>960</MV>
    <ML>223</ML>
    <MT>356</MT>
    <MH>692</MH>
    <MR>222</MR>
    <MU>230</MU>
    <YT>262</YT>
    <MX>52</MX>
    <FM>691</FM>
    <MD>373</MD>
    <MC>377</MC>
    <MN>976</MN>
    <ME>382</ME>
    <MA>212</MA>
    <MZ>258</MZ>
    <NA>264</NA>
    <NR>674</NR>
    <NP>977</NP>
    <NL>31</NL>
    <AN>599</AN>
    <NC>687</NC>
    <NZ>64</NZ>
    <NI>505</NI>
    <NE>227</NE>
    <NG>234</NG>
    <NU>683</NU>
    <KP>850</KP>
    <NO>47</NO>
    <OM>968</OM>
    <PK>92</PK>
    <PW>680</PW>
    <PA>507</PA>
    <PG>675</PG>
    <PY>595</PY>
    <PE>51</PE>
    <PH>63</PH>
    <PN>870</PN>
    <PL>48</PL>
    <PT>351</PT>
    <PR>1</PR>
    <QA>974</QA>
    <RO>40</RO>
    <RU>7</RU>
    <RW>250</RW>
    <BL>590</BL>
    <WS>685</WS>
    <SM>378</SM>
    <ST>239</ST>
    <SA>966</SA>
    <SN>221</SN>
    <RS>381</RS>
    <SC>248</SC>
    <SL>232</SL>
    <SG>65</SG>
    <SK>421</SK>
    <SI>386</SI>
    <SB>677</SB>
    <SO>252</SO>
    <ZA>27</ZA>
    <KR>82</KR>
    <ES>34</ES>
    <LK>94</LK>
    <SH>290</SH>
    <PM>508</PM>
    <SD>249</SD>
    <SR>597</SR>
    <SZ>268</SZ>
    <SE>46</SE>
    <CH>41</CH>
    <SY>963</SY>
    <TW>886</TW>
    <TJ>992</TJ>
    <TZ>255</TZ>
    <TH>66</TH>
    <TG>228</TG>
    <TK>690</TK>
    <TO>676</TO>
    <TN>216</TN>
    <TR>90</TR>
    <TM>993</TM>
    <TV>688</TV>
    <AE>971</AE>
    <UG>256</UG>
    <GB>44</GB>
    <UA>380</UA>
    <UY>598</UY>
    <US>1</US>
    <UZ>998</UZ>
    <VU>678</VU>
    <VA>39</VA>
    <VE>58</VE>
    <VN>84</VN>
    <WF>681</WF>
    <YE>967</YE>
    <ZM>260</ZM>
    <ZW>263</ZW>
</icc>
 
I hope this helps someone out there! If you need the same thing but using the 3 character country codes instead, let me know and I'll gladly generate one for you.
  • 5
post reply
red bottom sneakers
quote
posted by: guest 199.83.90.107 · date: 10:37 - 11 May 2013
Will you think of red bottom sneakers men immediately as soon as speaking of Christian Louboutin?Red bottom for men coupled with tight black trousers would enhance the feminine.Whether to attend the activities or day-to-day out to the streets,Red bottom Men Sneaker are the best choice.Simple Christian Louboutin Slingbacks should add a lot of self-confidence,too.Not only that,the Christian Louboutin Ankle Boots also handsome and really domineering!Needless to say, mens red bottom is the most important for every season!
cheap christian louboutin shoes
quote
posted by: guest 120.33.242.174 · date: 6:42 - 24 November 2012
Christmas is still far away, each brand christian louboutin sneakershas done sufficient preparation for Christmas. This season christian louboutin 2013, Christmas symbol color and religious symbols are drawn into trend elements, christian louboutin wedgesinto the blood, bring excellence fashion Christmas experience. The messiah's anthem resounded through the streets of Paris christian louboutin sneakers, Christmas Eve midnight mass solemn and devotions, christian louboutin slingbacksChristmas all and religious tied the relationship.
Christian Louboutin Sandalscontinue to give priority to dozen of printing element design style, christian louboutin pumpsfrom last season's cynicism into low-key, inside collect. Catholic an unstoppable, christian louboutin high bootsfusion graffiti style of digital and poster background, the virgin Mary like from the simple sense of religious image, christian louboutin eveningseeking overseas into fashion.
Christian Louboutin Ankle Bootstexture metal is always givenchy indispensable design inspiration. Christian Louboutin 20th anniversarywood, swarovski crystal, jewelry texture metal, gold, Christian Louboutin Bikiki 140 Pony Mary Jane Pumps Leopard Red Sole Shoespalau material such as mix and match, abandon lightsome, bring a strong sense of power, Christian Louboutin Rolando Hidden-Platform Pumps Black Red Sole Shoesand beautiful, stylish, perfection and pure.christianlouboutinsneaker01 1124
caps
quote
posted by: guest 58.63.72.75 · date: 4:31 - 08 November 2012
If you're looking for an exotic equipment, bottle-Replica caps belts certainly are a way-out item to use using violet jeans or maybe around the waist distinctive line of an extended t-shirt. The cost of making a bottle-Replica hats belt is fairly reduced, that makes jar Fashion hats from China straps well-liked by kids as well as young adults. A bottle-cap gear could also showcase the making expertise. Considering that each strip is unique, to match the particular container Wholesale fashion hats you utilize, additionally, you will have a one-of-a-kind item. http://w.livedoor.jp/printingforless/ http://w.livedoor.jp/printingcompanies/
So no auto escape of markup? OK I'll try again...
quote
posted by: guest 118.208.142.87 · date: 8:26 - 06 October 2012
Here are the missing codes (re-tried) <AG>1</AG> <AI>1</AI> <AS>1</AS> <AX>358</AX> <BB>1</BB> <BM>1</BM> <BS>1</BS> <BV>55</BV> <DM>1</DM> <DO>1</DO> <EH>212</EH> <GD>1</GD> <GF>594</GF> <GG>44</GG> <GP>590</GP> <GS>500</GS> <GU>1</GU> <HM>61</HM> <IO>246</IO> <IS>354</IS> <JE>44</JE> <JM>1</JM> <KN>1</KN> <KY>1</KY> <LC>1</LC> <MF>590</MF> <MP>1</MP> <MQ>596</MQ> <MS>1</MS> <NF>672</NF> <PS>970</PS> <RE>262</RE> <SJ>47</SJ> <TC>1</TC> <TF>689</TF> <TT>1</TT> <UM>699</UM> <VC>1</VC> <VG>1</VG> <VI>1</VI>
Some missing codes
quote
posted by: guest 118.208.142.87 · date: 8:15 - 06 October 2012
Thanks for this list. Most helpful. When using these on the iPhone I found there were some missing. I managed to find them from various sites around the Interwebs so they might even be correct! Here they are: 1 1 1 358 1 1 1 55 1 1 212 1 594 44 590 500 1 61 246 354 44 1 1 1 1 590 1 596 1 672 970 262 47 1 689 1 699 1 1 1
dasdasd
quote
posted by: guest 74.125.178.86 · date: 10:09 - 22 August 2012
Company card printing is most likely the first specifics people understand right after currently being interested in spend cash. printing for less
phone number formats
quote
posted by: guest 92.44.83.85 · date: 2:00 - 03 January 2012
Thanks for your work. Maybe developing a XML file with country code, calling code and phone number form(mask) would be helpful for localized applications.
 
Umit
untitled
quote
posted by: Lev · date: 15:54 - 10 November 2010
lev
What exactly are you trying to accomplish? Maybe I can lend a little more help...
"Be the change you want to see in the world." - Gandhi
apprentice » 7010 AP » total items: 567 / total posts: 26 » 0.143 / 1.143
thanks!
quote
posted by: guest 71.111.29.82 · date: 20:05 - 10 October 2010
 I've been Googling around for a maintained web service that I could make requests to, but your post is about closest I've been able to come.
Bookmark item @
bookmarkbookmarkbookmarkbookmarkbookmark