prop/lib/microwaveprop/radio
Graham McIntire 265669fc3a
Fix ADIF parser crash on records with multi-byte UTF-8 characters
Regex.scan with `return: :index` reports BYTE offsets, but String.slice/3
uses CHARACTER offsets. When a record contained a multi-byte UTF-8
character in an earlier field (e.g. "café" in NOTES), every subsequent
field's slice shifted one byte left, eventually landing on a literal
">" that crashed String.to_integer/1 with ArgumentError.

Switch to :binary.part/3 which is byte-based and matches what Regex.scan
reports. Also simplify the value offset calculation to use the scanned
tag_len directly instead of re-splitting the tag text. Reproduced in a
new regression test.

Prod stack trace: AdifImport.parse_fields/1 crashed on upload with
binary_to_integer(">") -- a FreeDV/N1MM logger that embedded UTF-8
characters in a NOTES field triggered it.
2026-04-12 15:13:59 -05:00
..
adif_import.ex Fix ADIF parser crash on records with multi-byte UTF-8 characters 2026-04-12 15:13:59 -05:00
callsign_client.ex Add dialyzer specs and types across the codebase 2026-04-12 08:55:04 -05:00
contact.ex Cache /contacts, fix map blink, make mode optional 2026-04-12 12:47:25 -05:00
contact_edit.ex Add dialyzer specs and types across the codebase 2026-04-12 08:55:04 -05:00
csv_import.ex Cache /contacts, fix map blink, make mode optional 2026-04-12 12:47:25 -05:00
edit_notifier.ex Send mail as prop@w5isp.com with reply-to graham@mcintire.me 2026-04-12 14:00:38 -05:00
enrichment_status.ex Add dialyzer specs and types across the codebase 2026-04-12 08:55:04 -05:00
maidenhead.ex Add /beacons CRUD and /users admin page 2026-04-08 12:01:45 -05:00