Phone number normalization: Any pre-existing libraries?

前端 未结 5 867
不知归路
不知归路 2021-02-05 07:35

I have a system which is using phone numbers as unique identifiers. For this reason, I want to format all phone numbers as they come in using a normalized format. Because I have

5条回答
  •  被撕碎了的回忆
    2021-02-05 08:14

    I'm currently involved in the OpenMoko project, which is developing a completely open source cell phone (including hardware). There has been a lot of trouble around normalizing phone numbers. I don't know if anyone has come up with a good solution yet. The biggest problem seems to be with US phone numbers, since sometimes they come in with a 1 on the front and sometimes not. Depending on what you have stored in your contacts list, it may or may not display the caller ID info correctly. I'd recommend stripping off the 1 on the phone number (though I'd expect most people wouldn't enter it in the first place). You may also need to look for a plus sign or country code on the front of international numbers.

    You can check around the OpenMoko website, mailing list, and source control to see if they've solved this bug yet.

提交回复
热议问题