fileSaveString

Saves a string to a file with specified text encoding. Takes a string, file path, and encoding value (0=ANSI, 1=UTF-8 with BOM, 2=UTF-16 LE with BOM). Returns 1 on success, 0 on failure.

File IO

Parameters & Returns

Parameters

str String
filepath String
encoding Int

Returns

Int

Quick Summary

Saves a string to a file with specified text encoding. Takes a string, file path, and encoding value (0=ANSI, 1=UTF-8 with BOM, 2=UTF-16 LE with BOM). Returns 1 on success, 0 on failure.

Technical Exegesis...

Writes a string to the specified file path using the specified encoding. Returns 1 on success, 0 on failure. Encoding values: 0 = ANSI (plain ASCII), 1 = UTF-8 (with BOM), 2 = UTF-16 LE (with BOM).

ANSI writes raw bytes. UTF-8 writes BOM (0xEF 0xBB 0xBF) then string. UTF-16 writes BOM (0xFF 0xFE) then converts from UTF-8 to UTF-16 using MultiByteToWideChar. Creates or overwrites the file.

Example

Example.bam
; No example implemented yet