This is GNU libiconv, packaged for Zig.
First, update your build.zig.zon
:
# Initialize a `zig build` project if you haven't already
zig init
zig fetch --save git+https://github.com/allyourcodebase/libiconv.git
You can then import libiconv
in your build.zig
with:
const libiconv_dependency = b.dependency("libiconv", .{
.target = target,
.optimize = optimize,
});
your_exe.linkLibrary(libiconv_dependency.artifact("iconv"));
Be aware that iconv is already available on most targets when linking libc. A notable exception is Windows.