Skip to content

fix(country): case-insensitive lookup, shared codes and CountryForNumber - #3

Merged
Cod3ddy merged 3 commits into
chore/tidyfrom
fix/country-lookup
Sep 30, 2026
Merged

Cod3ddy merged 3 commits into
chore/tidyfrom
fix/country-lookup

Conversation

@Cod3ddy

@Cod3ddy Cod3ddy commented Sep 29, 2026

Copy link
Copy Markdown
Owner

NewNormalizer and GetCountryByA2 now accept lower-case codes like "mw".

Shared dialling codes (1, 7, 44, 61 and others) now map to their main country, taken from libphonenumber, instead of whichever country came last in the file. GetCountryByCode("1") is now the US, not the US Minor Outlying Islands.

Adds CountryForNumber, which finds the country for a + number by trying the longest dialling code first, so +1 684… is American Samoa. A Canadian number still comes back as the US, because telling them apart needs area codes.

@Cod3ddy
Cod3ddy added this pull request to stack #8 September 29, 2026 21:29
@Cod3ddy
Cod3ddy merged commit 426f681 into main Sep 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant