Skip to content

(CU-86bbzfzvb) Feat: IsoUtils#getCountryName with the ISO 3166-1 country names, public IsoUtils#isUserAssignedCountryCode - #352

Merged
zubri merged 2 commits into
mainfrom
CU-86bbzfzvb_MyFormat-eliminate-the-integrator-country-map-use-Prowide-Core
Oct 6, 2026
Merged

zubri merged 2 commits into
mainfrom
CU-86bbzfzvb_MyFormat-eliminate-the-integrator-country-map-use-Prowide-Core

Conversation

@ptorres-prowide

@ptorres-prowide ptorres-prowide commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • New IsoUtils#getCountryName(code): the ISO 3166-1 English short name of a country, looked up by its alpha-2 (US), alpha-3 (USA) or numeric (840) code. Case-insensitive, tolerant to surrounding whitespace and to missing or extra leading zeros in the numeric code, independent of the default locale. Returns null for a code that is not officially assigned, including the user assigned XA-XZ range.
  • The table of officially assigned countries ships as the IsoCountries.txt resource (alpha-2;alpha-3;numeric;name, 249 rows), loaded on first use. No new public type; the existing IsoUtils country codes list and its addCountry/removeCountry customizations are unchanged.
  • Downstream use: Prowide Integrator MyFormat drops its private country catalog and resolves country names through this method (pw-swift-integrator#2055).

The names cannot come from java.util.Locale as the codes do: the JDK ships CLDR display names, 50 of the 249 differ from the ISO short names ("Antigua & Barbuda", "Turkey", "Russia", "United States"), and the JDK has no numeric codes, which the MyFormat transformation accepts since 9.4.9.

Test plan

  • IsoUtilsTest: lookup by the three codes, case and whitespace leniency, leading zeros, locale independence (ar-EG), unknown and user assigned codes, every JDK country has a name by alpha-2 and alpha-3
  • ./gradlew test and spotlessCheck green

@ptorres-prowide
ptorres-prowide force-pushed the CU-86bbzfzvb_MyFormat-eliminate-the-integrator-country-map-use-Prowide-Core branch 3 times, most recently from 155c54d to c61ff1d Compare September 29, 2026 10:58
…try names

New lookup of the English short name of a country by its alpha-2, alpha-3 or
numeric ISO 3166-1 code, case-insensitive and tolerant to missing or extra
leading zeros in the numeric code, independent of the default locale.
@ptorres-prowide
ptorres-prowide force-pushed the CU-86bbzfzvb_MyFormat-eliminate-the-integrator-country-map-use-Prowide-Core branch from c61ff1d to dae7475 Compare October 1, 2026 12:09
…icted to the XA-XZ ASCII range

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@zubri zubri changed the title (CU-86bbzfzvb) Feat: new IsoCountry enum with the ISO 3166-1 catalog (CU-86bbzfzvb) Feat: IsoUtils#getCountryName with the ISO 3166-1 country names, public IsoUtils#isUserAssignedCountryCode Oct 6, 2026
@zubri
zubri merged commit 2d6d0bb into main Oct 6, 2026
3 checks passed
@zubri
zubri deleted the CU-86bbzfzvb_MyFormat-eliminate-the-integrator-country-map-use-Prowide-Core branch October 6, 2026 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants