Text Parsing and Encoding Overview

Parsing and encoding are boundary decisions: the input syntax, accepted errors, and output form all matter. These topics connect common data formats to the tools that read and write them.

Converting Text and Scalar Values

Configuration and protocol values often cross a boundary between text and Booleans, integers, or floating-point numbers. Converting Text and Scalar Values explains fallback and throwing conversion, accepted input syntax, overflow, and the formatting options that create text for a particular destination.

Recognizing Small Text Patterns

Some boundaries are more expressive than a fixed prefix but do not justify a full parser. StringPattern describes these small shapes with literals, character ranges, and a front/back divider. Recognizing Text Patterns explains where patterns fit and how they match, trim, split, and return native positions.

Converting Strings and Encoded Data

Changing string width, encoding text into bytes, reading a text stream, and retaining a width-erased value are distinct boundary operations. Converting Strings separates those workflows and explains StringConverter, encoders and decoders, byte-order marks, strict and tolerant handling, streams, AnyString, and width-independent output.

Encoding Internationalized Names

Internationalized domain names require more than a Unicode-to-ASCII codec. IDNA2008 adds normalization, contextual, directionality, and DNS rules around the underlying Punycode representation. Encoding Internationalized Names explains when raw Punycode is appropriate and how to preserve useful failure information at a domain-name boundary.

Encoding Byte Data as Base-N Text

Binary bytes sometimes need to travel through text-only fields without losing their exact value. Encoding Byte Data as Base-N Text introduces Base16, Base32, and Base64 with a complete round trip. Continue with Writing Bytes as Base-N Text for alphabet, padding, and line-layout choices, or Reading Base-N Text into Bytes for validation, size limits, and input policy.

Parsing HTML Fragments into Documents

When short descriptions contain headings, emphasis, or links in HTML, they can become structured text without tying their presentation to the source markup. Parsing HTML into Documents shows how to turn a fragment into a TextDocument and render the same content with different terminal styles.

Parsing Compact Named-Key Parameters

Short option fields often read better when every value names its purpose. Parsing Compact Named-Key Parameters shows how to register a vocabulary, parse a comma-separated block, and turn its entries into application options. Continue with Configuring Named-Key Parameter Lists to choose aliases, entry policies, and value limits, then Customizing Named-Key Syntax to adapt delimiters, prefixes, compact values, and the accepted value alphabet.