Sample code for 30+ languages & platforms
Zig

Load utf-8 Text File into a StringBuilder

Demonstrates how to load a utf-8 text file into a StringBuilder object instance.

Chilkat Zig Downloads

Zig
const std = @import("std");
const chilkat = @import("chilkat");

pub fn main() !void {
    var success: bool = false;

    const sb = try chilkat.StringBuilder.init();
    defer sb.deinit();

    success = if (sb.loadFile("someFileContainingUtf8.txt", "utf-8")) true else |_| false;
    if (!success) {
        std.debug.print("Failed.\n", .{});
    } else {
        std.debug.print("Success.\n", .{});
    }
}