Dealing with phone numbers in contact book
If you are building an app that uses the userβs contact book then their certain gotchas to avoid. Telephone country codes are prefix-free If a country has a country code β+91β, then no other country will get a country code like β+912β or β+913β. This scheme ensures that numbers are inherently unambiguous. Telephone numbers can have multiple representations Since most people donβt dial internationally, telecom systems implicitly assume a domestic call. So, someone dialing 612-555-1234 in the US is dialing β+1-612-555-1234β, while the same person in India is dialing β+91-612-555-1234β. Since international dialing would be more infrequent, telecoms require unique prefix numbers like β00β to distinguish whether someone is 612-555-1234 in their country or 0061-255-51234 in Austria. In some states, even the domestic area code is not explicitly required. So, a user might have stored β555-1234β as the phone number to which telecoms will implicitly prefix the userβs area code. And if the user wants to dial beyond their area, the telecom operator would require an additional β0β prefix to mark that it is an STD call. This localization has a massive implication regarding processing cleaning and normalizing phone numbers retrieved from the userβs contact book. Both country code and area code donβt contain β0β, and usually, thatβs superfluous. So, while telecoms might be OK with calling or sending SMS to β0-612-555-1234β, they will treat a number like β91-0-612-555-1234β as incorrect. ...