Skip to content

Add explicit ASCII-based int values to Alpha3Code enum#65

Merged
tinohager merged 2 commits intomainfrom
copilot/convert-alpha3code-to-int
Feb 9, 2026
Merged

Add explicit ASCII-based int values to Alpha3Code enum#65
tinohager merged 2 commits intomainfrom
copilot/convert-alpha3code-to-int

Conversation

Copy link
Contributor

Copilot AI commented Feb 9, 2026

Alpha2Code encodes its int values by concatenating ASCII codes of the two characters (e.g., AF6570). Alpha3Code had no explicit values, defaulting to sequential ints. This applies the same scheme to Alpha3Code.

  • Alpha3Code.cs: Changed enum to : int, assigned each member its ASCII-concatenated value (e.g., AFG = 657071, USA = 858365)
  • Alpha3Code.cs: Added <remarks> XML doc explaining the value scheme, matching Alpha2Code
  • CountryTest.cs: Added test validating all 250 members have correct ASCII-derived values
// Before
public enum Alpha3Code
{
    AFG,
    ALA,
    ...
}

// After
public enum Alpha3Code : int
{
    AFG = 657071,  // A(65) + F(70) + G(71)
    ALA = 657665,  // A(65) + L(76) + A(65)
    ...
}

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: tinohager <8215186+tinohager@users.noreply.github.com>
Copilot AI changed the title [WIP] Convert Alpha3Code to integer value using ASCII Add explicit ASCII-based int values to Alpha3Code enum Feb 9, 2026
Copilot AI requested a review from tinohager February 9, 2026 14:49
@tinohager tinohager marked this pull request as ready for review February 9, 2026 14:51
@tinohager tinohager merged commit 7dfebb6 into main Feb 9, 2026
1 check 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.

2 participants