adif-multitool icon indicating copy to clipboard operation
adif-multitool copied to clipboard

Surprising results for validate on STATE with a DXCC without administrative enum

Open flwyd opened this issue 1 year ago • 0 comments

The current behavior of adifmt validate on the STATE field for a DXCC which doesn't have entries in the Primary_Administrative_Subdivision enumeration is:

  • If the state matches a value from a different DXCC, it's a warning
  • If no other DXCC has a subdivision with that code, it's an error

For example, Azerbaijan (DXCC 18) doesn't have any ADIF-specified subdivisions, so BAB and BA are warnings (matching Bratislava and Bahia, among others) but ABS and QAX do not. (See ISO 3166-2:AZ.)

The warning behavior holds even if the DXCC does have administrative regions in the enum, which means validate only issues a warning if you mistakenly log ON in the United States instead of Canada.

Since the STATE field is an enumeration (and not a string like SUBMODE), it's presumably invalid to have a value in that field if the primary administrative subdivisions for that country aren't enumerated in the ADIF spec, whether or not the state code would be valid for a different country. I wonder if it would be reasonable to incorporate all of ISO 3166-2 in the ADIF enumeration spec.

flwyd avatar Feb 01 '24 06:02 flwyd