Skip to content

Text core

github-actions[bot] edited this page Aug 22, 2026 · 23 revisions

Core — Lodestar.Text

The Lodestar.Text namespace itself holds one type, and it is one every other namespace in the package takes as a parameter: TextElement, which says what counts as one character.

That question has two answers in .NET and they disagree wherever text leaves the Basic Multilingual Plane — an emoji, an ancient script, a rare CJK ideograph. A string is a sequence of UTF-16 code units, and such a character occupies two of them. Treating those two as separate characters is fast and is what .NET does by default; treating them as one is what Python does, and what a user comparing two names would expect.

Every distance in Lodestar.Text.Distances takes this as its last parameter, so the choice is made per call rather than per process.

Types

Type What it is
TextElement Whether one character means a UTF-16 unit or a code point.

See also

Lodestar

Project

Clone this wiki locally