Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect handling of GB alpha2 codes for main countries #73

Open
joh-ku opened this issue Jun 1, 2024 · 2 comments
Open

Incorrect handling of GB alpha2 codes for main countries #73

joh-ku opened this issue Jun 1, 2024 · 2 comments

Comments

@joh-ku
Copy link

joh-ku commented Jun 1, 2024

When searching for countries.ByName("scotland") the return value is GB.

For Scotland the correct ISO-3166-2 code should be GB-SCT instead. Same applies for all other main countries in UK, which don't have a parent subdivision.

Those are:

  1. England -> GB-ENG
  2. Northern Ireland -> GB-NIR
  3. Scotland -> GB-SCT
  4. Wales -> GB-WLS

See https://www.iso.org/obp/ui/#iso:code:3166:GB.

I'm happy to provide a PR, if the change is accepted.

@biter777
Copy link
Owner

biter777 commented Jun 5, 2024

Ok
Do a pr pls, if u can

@ccoVeille
Copy link

ccoVeille commented Jun 5, 2024

My main concern is the fact the lib may return an ISO code with more than 2 characters. Some database or code may react badly, because value will exceed field capacity

So, what about a new method ? that will provide such an extended code that will return the existing 2 letter code except for these variants.

So keep returning iso code to GB for existing method. Scotland is part of GB after all.

If someone asks the country code of Scotland they would expect getting GB I think.

I'm a bit afraid of breaking change

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

No branches or pull requests

3 participants