cedvdb / phone_numbers_parser

Dart phone number parser, based on libphonenumber and PhoneNumberKit.
https://pub.dev/packages/phone_numbers_parser
MIT License
63 stars 33 forks source link

4 digit country code issue #8

Closed rishabhj126 closed 3 years ago

rishabhj126 commented 3 years ago

While selecting American Samoa number (+1684) it shows iso code as AS but country code is shown as +1 only

cedvdb commented 3 years ago

While selecting American Samoa number (+1684)

I believe the list you used is conflating country code and leading digits. Note that the number you selected, contains two things

I believe Google metadata is correct in this case. In American Samoa phone numbers might start with 1-684 but they can also start with 1-685. See wikipedia https://en.wikipedia.org/wiki/Telephone_numbers_in_Samoa

Example: +685 XX XXX

Here is the metadata from google:

    <territory id="AS" countryCode="1" leadingDigits="684" internationalPrefix="011"
               nationalPrefix="1" nationalPrefixForParsing="1|([267]\d{6})$"
               nationalPrefixTransformRule="684$1">

https://github.com/google/libphonenumber/blob/master/resources/PhoneNumberMetadata.xml

If you still believe this is incorrect, respond and I will reopen