Module line_endings

Module line_endings 

Source
Expand description

Line ending detection, universal line splitting, and format conversion.

Structs§

LineEndingFormat
Full specification of line ending style and termination mode.

Enums§

CharEncoding
Structured single-byte character encoding settings.
LineEndingKind
Line ending delimiter pattern.
LineEndingOption
Option controlling line ending conversion during encoding, decoding, and transcoding.
TerminationMode
Mode defining whether newlines terminate every line or only separate lines.

Constants§

CR
CRLF
LF
Universal newline delimiter character constants and slices.
LFCR
NEL
RS

Functions§

apply_line_ending_option
Converts line endings in a string according to a LineEndingOption and target encoding.
convert_line_endings
Converts all line endings in a string to the specified LineEndingFormat.
detect_line_ending
Detects the predominant line ending delimiter in a string.
normalize_to_lf
Normalizes all line endings in the string to standard POSIX LF (\n).
split_lines_universal
Splits a string into lines, recognizing all supported line ending variants: \r\n, \n\r, \r, \n, \x1E, and \u{0085} (NEL).