Back to API Reference
Class
FileTextSource
static
Loads a file into a Rope without decoding it: UTF-8 content stays UTF-8 in the blocks, referencing the loaded chunks (or the memory mapping) directly, so residency is the file size, not twice it. Blocks are cut at paragraph boundaries where possible and never inside a UTF-8 sequence or a CRLF pair; their facts are computed in parallel on WorkerPool.
Remarks
UTF-16 and UTF-32 files decode to UTF-16 blocks. Invalid UTF-8 bytes decode to U+FFFD one byte at a time; a leading BOM is skipped. The backend is chosen once, at load; a memory mapping that fails to open falls to chunked reads only under
Auto, never mid-session.public static Rope Load()Loads a file into a new rope.
public static Rope FromBytes()Builds a rope from bytes already in memory the way Load reads a file: UTF-8 content stays in bytes, referenced by the blocks, so the memory must stay unmodified for the document's life; other encodings are decoded into the blocks.
