AS names lose or garble accented letters #165

Closed
opened 2026-10-26 21:33:15 +01:00 by clawbot · 1 comment
Collaborator

What is wrong. AS names lose or garble accented letters, in two places:

  • The AS list built into the program has no letter outside ASCII. AS1251 reads "FUNDAO DE AMPARO PESQUISA DO ESTADO SO PAULO"; the source, https://github.com/ipverse/asn-info (as.csv), has "FUNDAÇÃO DE AMPARO À PESQUISA DO ESTADO SÃO PAULO". A name search for "São Paulo" finds nothing.
  • WHOIS answers from LACNIC are in Latin-1, and are stored as received. The log shows "Brasrede Telecomunica��es LTDA", and the pages show the same replacement characters.

Also, make asupdate, which rebuilds the built-in list, now stops with "Unexpected CSV header": as.csv has a fourth column, country, after asn, handle and description.

What acceptable looks like.

  • cmd/asinfo-gen reads today's as.csv header and keeps names exactly as the source spells them. Keeping the country column is out of scope; the generator reads past it.
  • pkg/asinfo/asdata.json.gz regenerated with make asupdate, accents intact.
  • internal/whois stores answers as UTF-8: an answer that is already valid UTF-8 is kept, and one that is not is decoded as Latin-1 (golang.org/x/text/encoding/charmap).

Definition of done.

  • Tests that fail on the current code: the generator's parsing of a four-column header with an accented name, and a Latin-1 WHOIS answer giving a correct UTF-8 organisation name.
  • The regenerated list, and one reviewed PR into next.

Model: opus-5-5

**What is wrong.** AS names lose or garble accented letters, in two places: - The AS list built into the program has no letter outside ASCII. AS1251 reads "FUNDAO DE AMPARO PESQUISA DO ESTADO SO PAULO"; the source, https://github.com/ipverse/asn-info (`as.csv`), has "FUNDAÇÃO DE AMPARO À PESQUISA DO ESTADO SÃO PAULO". A name search for "São Paulo" finds nothing. - WHOIS answers from LACNIC are in Latin-1, and are stored as received. The log shows "Brasrede Telecomunica��es LTDA", and the pages show the same replacement characters. Also, `make asupdate`, which rebuilds the built-in list, now stops with "Unexpected CSV header": `as.csv` has a fourth column, `country`, after `asn`, `handle` and `description`. **What acceptable looks like.** - `cmd/asinfo-gen` reads today's `as.csv` header and keeps names exactly as the source spells them. Keeping the country column is out of scope; the generator reads past it. - `pkg/asinfo/asdata.json.gz` regenerated with `make asupdate`, accents intact. - `internal/whois` stores answers as UTF-8: an answer that is already valid UTF-8 is kept, and one that is not is decoded as Latin-1 (`golang.org/x/text/encoding/charmap`). **Definition of done.** - Tests that fail on the current code: the generator's parsing of a four-column header with an accented name, and a Latin-1 WHOIS answer giving a correct UTF-8 organisation name. - The regenerated list, and one reviewed PR into `next`. Model: opus-5-5
clawbot self-assigned this 2026-10-26 21:33:15 +01:00
Author
Collaborator

Built in #172: the generator reads today's as.csv, the built-in list is regenerated with its accents, and a WHOIS answer that is not valid UTF-8 is decoded as Latin-1.

One correction to this issue: LACNIC answers in UTF-8. For a Brazilian AS its answer already holds the replacement characters, so those WHOIS names stay garbled after this change. The PR body has the details.

Model: opus-5-5

Built in https://git.eeqj.de/sneak/routewatch/pulls/172: the generator reads today's `as.csv`, the built-in list is regenerated with its accents, and a WHOIS answer that is not valid UTF-8 is decoded as Latin-1. One correction to this issue: LACNIC answers in UTF-8. For a Brazilian AS its answer already holds the replacement characters, so those WHOIS names stay garbled after this change. The PR body has the details. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/routewatch#165