Expand description
Encoding and line-ending state for a TextBuffer.
Owns the four format-related fields (current line-ending,
original line-ending at load, current encoding, original encoding
at load) as a BufferFormat sub-struct composed inside
TextBuffer. Exposes pure free functions for detection and
conversion so they can be used without constructing any buffer
state.
Structs§
- Buffer
Format - Encoding + line-ending state for one
TextBuffer.
Enums§
- Line
Ending - Line-ending format detected in (or chosen for) a text buffer.
Functions§
- convert_
to_ encoding - Convert UTF-8 content to the specified encoding for saving.
- detect_
and_ convert_ encoding - Detect encoding and convert bytes to UTF-8.
- detect_
encoding - Detect the text encoding from a sample of bytes.
- detect_
encoding_ or_ binary - Detect the text encoding and whether content is binary.
- detect_
line_ ending - Detect the line ending format from a sample of bytes
- normalize_
line_ endings - Normalize line endings in the given bytes to LF only.