diff --git a/internal/dxcc/dxcc.go b/internal/dxcc/dxcc.go index f00c46c..3210f72 100644 --- a/internal/dxcc/dxcc.go +++ b/internal/dxcc/dxcc.go @@ -303,11 +303,12 @@ func normalizeCallsign(s string) string { if p == "" { continue } - // A TRAILING /MM (maritime) or /AM (aeronautical) mobile is stripped and - // the operator's home entity is kept, so the contact still resolves to a - // country in the log (e.g. YB1SCY/AM → Indonesia). A LEADING "MM" is the - // Scotland operating prefix (MM/F4NIE) and must NOT be stripped. - if i > 0 && (p == "MM" || p == "AM") { + // A TRAILING /MM (maritime) or /AM (aeronautical) mobile, or /B (beacon), is + // stripped and the operator's home entity is kept, so the contact still + // resolves to a country in the log (e.g. YB1SCY/AM → Indonesia, 4U1UN/B → + // 4U1UN → United Nations HQ). A LEADING "MM"/"B" is a PREFIX (MM = Scotland, + // B = China: B/F4NIE) and must NOT be stripped. + if i > 0 && (p == "MM" || p == "AM" || p == "B") { continue } if suffixModifiers[p] { diff --git a/internal/dxcc/dxcc_test.go b/internal/dxcc/dxcc_test.go index 5dd1926..daaf8fb 100644 --- a/internal/dxcc/dxcc_test.go +++ b/internal/dxcc/dxcc_test.go @@ -224,6 +224,8 @@ func TestNormalize(t *testing.T) { "MM/LY3X/P": "MM", "F4BPO/W6": "W6", "VK9/F4BPO": "VK9", + "4U1UN/B": "4U1UN", // trailing /B = beacon → strip, keep the base call + "B/F4BPO": "B", // leading B = China operating prefix, NOT a beacon } for in, want := range cases { if got := normalizeCallsign(in); got != want {