Berildocs GitHub

Memory cards

A string is bytes plus an encoding; a character is a grapheme

confidence: highupdated: 2026-11-25status: activenumericsunicodeencoding

Claim#

UTF-8 is a byte encoding. Normalization unifies equivalent sequences; a grapheme cluster is what a user sees.

Test#

Reverse a string with an emoji and a combining mark. Compare by code point and by grapheme.

Proof#

A length and a reversal that match user perception.

Failure modes#

A byte length is not a character count. Comparing without normalization misses equality.