Radar · Go · Archive · Week 9 · Feb 24 – Mar 2, 2025
unicode: add CategoryAliases, LC, Cn
Worth knowingstdlib
- What changed
- A new
CategoryAliasesmap, and theLCandCnrange tables were added to the unicode package. - Production impact
- The source does not say.
- Try it
- Use
unicode.CategoryAliases["Letter"]in a small program. - Source
- github.com/golang/go/issues/70780
Understand it, then run it
The Unicode package in Go keeps tables that describe what each character is. A long time ago the tables did not include a small map that tells the package which short names mean which long names. For example, the short name L means “Letter”, but the long name Letter was not linked. The change adds a map called CategoryAliases that maps names like Letter to the short form L. It also adds two new tables, LC for “Cased Letter” and Cn for “Unassigned”, so that the package can refer to them directly.
Written by gpt-oss-20b from the linked source · claims checked against the sources · archive, not individually reviewed