phone_numbers_parser icon indicating copy to clipboard operation
phone_numbers_parser copied to clipboard

Phone number formatting does not comply with libphonenumber specification

Open fpbouchard opened this issue 1 year ago • 1 comments

As is documented here, to prevent data deduplication, format rules are not copied to all NANPA countries, and the mainCountryForCode attribute is set for countries that share the same calling code.

I am willing to submit a PR that fixes this. From my understanding of the code, my two choices would be to duplicate the formats in metadata_formats_by_iso_code.dart, but increasing the file by ~1200 lines, or refactor PhoneMetadataFormat so that it can either refer to another IsoCode or contain a list of PhoneMetadatFormat.

I prefer the second approach, but I ignore if the generated files have to remain stable or if they can be changed.

Let me know!

fpbouchard avatar Sep 18 '24 12:09 fpbouchard

Hello @fpbouchard Thanks for the detailed issue and research. I'm with you for the second approach. Since the metadata is currently public, this would still need a major semver upgrade.

cedvdb avatar Sep 18 '24 16:09 cedvdb