SplitScript reference / Process / readUtf16Le

Process.readUtf16Le

Method

Process.readUtf16Le(address: address, maxUtf16Units: u32) -> String!

Reads a bounded NUL-terminated UTF-16LE string.

At most maxUtf16Units little-endian UTF-16 code units are read in one host operation. Decoding stops at the first NUL code unit. Memory-access failure, a zero or excessive bound returns an error. Unpaired surrogate code units decode as the Unicode replacement character. The result is an ordinary immutable SplitScript String.

Parameters

  • address: The address of the first little-endian UTF-16 code unit.
  • maxUtf16Units: The maximum number of UTF-16 code units to read, up to 2048.

Effects: reads process memory, requires an attached process

Runtime behavior: available while a process is attached, except in onDetach; synchronous

Examples

Read a native Windows string

let chapter = process.readUtf16Le(chapterAddress, 64) else "Unknown"