I want to import all the contacts number from user's phone address book and store them in the database but since I want to do some processing on them later, all of the phone numbers should have a unify format.
I have done some research on the Internet and I find out that there are three major format for phone-numbers: (source: googlei18n/libphonenumber)
- INTERNATIONAL
- NATIONAL
- E164
Then I export and extract my phone contact numbers but I understand that there are plenty of different format numbers from different countries and carriers.
Here's some example:
0123456789
0 12-345 6789
+6012345678
+27 60 123 4567
09131234567
+98 (310) 1234567
00982101234567
Based-on google's library, if you want to convert any phone number to a different format, I guess, you have to know which country they're belong to and in my case, every contact belongs to different country.
Now, my question is what are the steps to prepare and convert all of them to one specific format?
I need to know the whole concept of this operation but If you want to write code, any programming language is okay.