egbakou / RESTCountries.NET

⚡Offline dotnet standard library to get information about countries
https://lioncoding.com
MIT License
287 stars 19 forks source link

IDD seems not correct #13

Closed PassionateDeveloper86 closed 1 year ago

PassionateDeveloper86 commented 1 year ago

Hi,

thank you for your lib, I saw it on reddit and it fullfills a need I have very recently.

Sadly it seems the IDD is not well implemented. Here you have a Root and a Suffix, weil Suxffix is a list.

E.g. for Germany your Root is +4 and your suffix is 9. E.g. for Vatican Country you list the Root as +3 with 2 suffixes: 79 and 906698 E.g. for DomRep your root is +1 and 3 sufffices.

That seems "wrong":

Compared with https://countrycode.org

In Germany +49 is the complete country code. So the logic would be Take Root + Suffix. In Vatican it seems +379 is the country code. So the logic would be take Root + 1 suffix (no way to find out which one, else then knowing) In DomRep it seems +1 is the country code. So the logic would be ignore suffix, just take Root.

Can we have a logic in which the country code is a property allways or maybe have the IDD and Suffix all countries the same way?

PassionateDeveloper86 commented 1 year ago

Any updates?

egbakou commented 1 year ago

Hi @PassionateDeveloper86, Thanks for the issue.

I will look at it this weekend.

amatosg commented 1 year ago

I'm working on this so the full IDD is also available :)

mmattes commented 1 year ago

Any news on this issue?

amatosg commented 1 year ago

I do this on my free time, so it might take a while

egbakou commented 1 year ago

Hi @PassionateDeveloper86 @amatosg @mmattes I have been working on this issue for a while, and I have just realized that everything is okay. There are no issue. The Vatican IDD is correct according toWikipedia 's list of country calling codes and the link provided by @PassionateDeveloper86. Please see the screenshot below.

I will advise you to do this: If the suffix array contains only one element, then concatenate the Root with that element. If there are multiple elements in the array, concatenate the Root with each element to obtain multiple IDD.

More info: image

If there are no further questions or issues, I will proceed to close this issue.

egbakou commented 1 year ago

Fell free to reopen this issue if needed !