Skip to content

unicode: Unicode 17.0.0 is the width and grapheme authority - #32

Merged
tawago merged 1 commit into
mainfrom
unicode-17-authority
Sep 12, 2026
Merged

tawago merged 1 commit into
mainfrom
unicode-17-authority

Conversation

@tawago

@tawago tawago commented Sep 12, 2026

Copy link
Copy Markdown
Owner

This lands Unicode 17.0.0 as the width and grapheme authority: the vendored UCD and emoji data under vendor/unicode/17.0.0 (SHA-256 digests recorded in tools/unicode/generate.zig), the generated tables under src/lib/unicode/generated, the library src/lib/unicode.zig, its generator, and a zig build unicode-check step that regenerates the tables offline and byte-compares them against the committed ones. tools/unicode/fetch.sh is the only path that touches the network.

It is the first slice of #31, split out so the data-heavy part can be reviewed and merged on its own. #31 is now based on this branch and retargets to main automatically once this merges. Every symbol main's callers use keeps its signature.

Deviations from #31

  • wrapLine and legacyValidPrefix are restored verbatim, because main's markdown table renderer still calls wrapLine.
  • The three nextGlyph callers (src/tui/app.zig, src/tui/selection.zig, src/core/markdown/render/frontmatter.zig) gained a one-byte floor on their advance. The new nextGlyph reports a malformed byte as an empty slice, which would otherwise hang those loops on invalid UTF-8. Each site has a regression test.

Behavior notes

  • codepointWidth now gives emoji-presentation code points width 2 and C1 controls width 0 (callers in src/export and the legacy mermaid canvas).
  • The compact front-matter style now breaks a value at a malformed byte instead of carrying it in-word. Invalid UTF-8 only.
  • Rendering of valid input under the current renderer is unchanged.

Verification

  • zig build, zig build test (1663 passed, 3 skipped), zig build unicode-check, zig fmt --check, all green on this branch alone.

🤖 Generated with Claude Code

https://claude.ai/code/session_012r9nF92bG3LRf1DC3r933M

…d UCD data pinned by SHA-256, generated tables, the library, and its generator

vendor/unicode/17.0.0 holds the Unicode Character Database and emoji data
files the tables derive from. Their SHA-256 digests are recorded in
tools/unicode/generate.zig and in the generated manifest.zig; PIN.md points
at those. tools/unicode/fetch.sh is the only path that touches the network;
a normal build and `zig build unicode-check` (regenerate and byte-compare the
tables) run offline. Every symbol main's callers use is still exported with
the same signature.

Two deviations from the feature branch this is extracted from. wrapLine and
legacyValidPrefix are restored verbatim from 6d65f9b^ because main's
src/core/markdown/render/table.zig still calls wrapLine. The three nextGlyph
callers (src/tui/app.zig, src/tui/selection.zig,
src/core/markdown/render/frontmatter.zig) gained a one-byte floor on their
advance, because the new nextGlyph reports a malformed byte as an empty
slice and an unfloored loop would never move past it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012r9nF92bG3LRf1DC3r933M
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant