Expand description
Encoding detection and conversion utilities.
This module provides utilities for handling text encoding in terminal I/O, including UTF-8 validation, encoding detection, and line ending normalization.
Structs§
- Encoded
Text - Result of encoding a byte sequence to text.
Enums§
- Detected
Encoding - Detected encoding from environment.
- Line
Ending Style - Line ending styles.
Functions§
- decode_
utf8_ escape - Decode bytes as UTF-8, escaping invalid bytes as hex.
- decode_
utf8_ lossy - Decode bytes as UTF-8, replacing invalid sequences.
- decode_
utf8_ skip - Skip invalid UTF-8 sequences.
- decode_
utf8_ strict - Decode bytes as UTF-8, returning an error on invalid sequences.
- detect_
encoding_ from_ env - Detect encoding from environment variables.
- detect_
line_ ending - Detect the predominant line ending in text.
- normalize_
line_ endings - Normalize line endings in text.
- strip_
ansi - Strip ANSI escape sequences from text.