BenBurgers.InternationalStandards.Iso 0.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package BenBurgers.InternationalStandards.Iso --version 0.1.0                
NuGet\Install-Package BenBurgers.InternationalStandards.Iso -Version 0.1.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="BenBurgers.InternationalStandards.Iso" Version="0.1.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add BenBurgers.InternationalStandards.Iso --version 0.1.0                
#r "nuget: BenBurgers.InternationalStandards.Iso, 0.1.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install BenBurgers.InternationalStandards.Iso as a Cake Addin
#addin nuget:?package=BenBurgers.InternationalStandards.Iso&version=0.1.0

// Install BenBurgers.InternationalStandards.Iso as a Cake Tool
#tool nuget:?package=BenBurgers.InternationalStandards.Iso&version=0.1.0                

Introduction

This solution provides international standards for use in applications, interfaces and services. The authors of this solution are going to the greatest extent to stay true to the standards as they have been adopted, although it cannot be guaranteed that they will always be up to date. Please refer to the official documentation and authority of the respective standard for the latest contents, in case of doubt.

GitHub Sponsors

If you like my contributions, please have a look at my GitHub Sponsors profile. My open source contributions are available free of charge (but subject to licenses) and the contributions are made entirely in my free time, but sponsorship would be sincerely appreciated. Thank you.

Packages

ISO

The BenBurgers.InternationalStandards.Iso package contains standards of the International Organization for Standardization (ISO).

The International Organization for Standardization (ISO) is an international standard development organization composed of representatives from the national standards organizations of member countries. The organization develops and publishes standardization in all technical and nontechnical fields other than electrical and electronic engineering.[^1]

[^1]: Wikipedia, downloaded at 31 October 2022, 23:33 CET.

ISO 3166

The ISO 3166 standard defines country codes. The list of country codes may include AQ for Antarctica, or NL for the Netherlands.

The Alpha-2 code is a two-letter code as previously mentioned.

The Alpha-3 code is a three-letter code.

There is also a numeric code, which is unique for every country.

Example
using System.Globalization;
using BenBurgers.InternationalStandards.Iso.Iso3166;

var antarctica = Iso3166Code.Antarctica;
var alpha2 = antarctica.ToAlpha2(); // "AQ"
var alpha3 = antarctica.ToAlpha3(); // "ATA"
var numeric = (int)antarctica; // 010

var cultureInfo = new CultureInfo("fr");
var nameShort = antarctica.GetName(Iso3166NameVariant.Short, cultureInfo); // "Antarctique"
var nameLong = antarctica.GetName(Iso3166NameVariant.Long, cultureInfo); // "Antarctique"

ISO JSON

The BenBurgers.InternationalStandards.Iso.Json package contains features for serializing and deserializing to and from JSON using the ISO standards. The package provides, among other features, JSON converters that may be added to the serialization options in order to control the serialization and deserialization of ISO compliant data.

ISO 3166

There are JSON Converters for ISO 3166 from and to the alpha-2 and alpha-3 codes as well as the numeric code.

Example
using BenBurgers.InternationalStandards.Iso.Iso3166;
using BenBurgers.InternationalStandards.Iso.Json.Iso3166.Alpha;
using System.Text.Json;

const Iso3166Code Value = Iso3166Code.Antarctica;
var options = new Iso3166JsonConverterOptions(Iso3166AlphaMode.Alpha2);
var jsonConverter = new Iso3166AlphaJsonConverter(options);
using var stream = new MemoryStream();
using var writer = new Utf8JsonWriter(stream);

writer.WriteStartObject();
writer.WritePropertyName("Antarctica");
jsonConverter.Write(writer, Value, new JsonSerializerOptions());
writer.WriteEndObject();
writer.Flush();

/*
* The result will be:
*
* {"Antarctica":"AQ"}
*/

Supported Languages

The supported languages in the ISO packages are:

ISO 639-1 Name
neutral
en English
fr French
nl Dutch

More may be added in the future.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on BenBurgers.InternationalStandards.Iso:

Package Downloads
BenBurgers.InternationalStandards.Iso.Json

JSON features for international standards as adopted by the International Organization for Standardization (ISO). This may include country codes, language codes and more.

BenBurgers.InternationalStandards.Iso.IO

Input/Output for international standards as adopted by the International Organization for Standardization (ISO). This may include country codes, language codes and more.

BenBurgers.InternationalStandards.Iso.EFCore

Entity Framework Core (SQL Server) features for international standards as adopted by the International Organization for Standardization (ISO). This may include country codes, language codes, currency codes and more.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.6.0 138 11/24/2024
0.5.0 386 12/5/2023
0.4.0 601 1/3/2023
0.3.0 941 11/15/2022
0.2.0 564 11/9/2022
0.1.0 489 11/4/2022