📜 ⬆️ ⬇️

ISO-3166 in the .NET Framework

In one of the projects a need arose - by the name of the country in English to get its two-letter code.
As you know, two-letter designations for countries of the world are specified in ISO 3166-1 .
The disappointment for me was that in the .NET Framework there is no direct support for this standard.
I had to invent my bike.

What for?


There are not so many existing bikes for .NET.
In addition, the only option that was available at the time of solving the problem was updated in 2012 and contained an array of countries with information about them.
It’s clear that you’ll not be fully fed up with an array search, and there’s no point in cramming a dictionary over (why then was it necessary to install a library at all?).
The last straw was that after extracting information from CultureInfo.GetCultures
suddenly there was no country called Andorra.
Do you really need to take something manually from the registry?

What is the result?


GitHub: Bia.Countries
NuGet: Bia.Countries

I will be glad to receive constructive comments!

')

Source: https://habr.com/ru/post/233017/


All Articles