#ifndef CHARSET_H #define CHARSET_H #include /* * Convert input (UTF-8, UTF-16 with BOM, or ISO-8859-1) to ISO-8859-1. * Unmappable characters (> U+00FF) are replaced with '?'. * Returns number of bytes written (excluding null terminator). * Output is always null-terminated. */ int to_iso8859_1(const unsigned char *in, size_t in_len, char *out, size_t out_size); #endif