Examples

The examples are small standalone programs, but each one maps to a real class of integration problem. They all build against polycpp::iconv_lite without private headers.

Example

Use it when…

Batch conversion

You have a complete payload and need one encode/decode operation.

BOM-sensitive payloads

You read or write UTF payloads where an initial BOM matters.

Stateful conversion

You receive chunks and need to preserve incomplete byte sequences.

Streaming conversion

You want a polycpp transform stream around the stateful converters.

Validating labels

Encoding names come from config, headers, metadata, or user input.

Running an example

From the repository root:

cmake -B build -G Ninja -DPOLYCPP_ICONV_LITE_BUILD_EXAMPLES=ON
cmake --build build --target polycpp_iconv_lite_example_convert
./build/examples/convert

All examples are emitted under build/examples/ when POLYCPP_ICONV_LITE_BUILD_EXAMPLES is enabled.