πŸ”¨ iconv_encoding (In Progress)ΒΆ

Warning

πŸ”¨ This isn’t finished yet! Come check back by the next major or minor version update.

This encoding is only available if the configuration macro for ZTD_TEXT_USE_ICONV is turned on.

This encoding is tied to the iconv library. It will attempt to bootstrap iconv on first use of the encoding through use of GetProcAddress/dlsym and friends. If it cannot find it will either assert, abort, or loudly annoy the user in some way. The code is retrieved dynamically, as iconv is under a LGPL/GPL licensed and cannot be traditionally built / statically linked with application code (though in the future we may provide a way for software to do that if the software being made with this library is also GPL-compatible software).

iconv has a fixed set of encodings it can be compiled with to support. States are pre-constructed in the encoding itself and copied as necessary when encode_state or decode_states are being created to call the iconv functions. The user can inspect the output error parameter from the iconv_encoding constructor to know of failure, or not pass in the output error parameter and instead take one of a assert, thrown exception, or abort (preferred invocation in that order).