Expand description
Talk table (TLK) binary support. TLK V3.0 binary reader and writer.
TLK is the global talk table format used for localized game strings. Entries store flags, optional voice-over resrefs, and text offsets into a shared string blob.
§Shape of the container
A fixed 20-byte header, an entry table starting immediately after it, and a
text blob at entries_offset. Each entry’s text_offset is measured from
the blob rather than from the start of the file, so the two offsets compose
rather than one superseding the other.
Two things to know before touching a reader here. The engine does not
validate the version tag but does use it to pick the entry stride, so a
mistyped version parses at the wrong width instead of failing. And there is
no encoding declaration in the file at all: language_id selects it, and we
enforce that mapping strictly rather than guessing, so a mislabelled table
fails loudly instead of producing mojibake.
Byte-level field maps for the header and the entry record live in
docs/src/formats/text/tlk.md, with the engine’s own load sequence.
Structs§
- Tlk
- In-memory representation of a TLK talk table.
- TlkEntry
- One TLK string entry and its metadata flags.
Enums§
- TlkBinary
Error - Errors produced while parsing or serializing TLK binary data.
Functions§
- read_
tlk - Reads a TLK from a reader.
- read_
tlk_ from_ bytes - Reads a TLK from in-memory bytes.
- write_
tlk - Writes a TLK to a writer in KotOR TLK V3.0 binary format.
- write_
tlk_ to_ vec - Serializes a TLK to a byte vector in KotOR TLK V3.0 format.