#include #include #include "images.h" #include class IConv { iconv_t ic; public: IConv(const char *to, const char *from) : ic(iconv_open(to, from)) {} ~IConv() { iconv_close(ic); } int convert(char *input, char *output, size_t outbufsize) { size_t inbufsize = strlen(input); size_t orig_size = outbufsize; // memset(output, 0, outbufsize); // https://www.gnu.org/savannah-checkouts/gnu/libiconv/documentation/libiconv-1.15/iconv.3.html int r = iconv(ic, &input, &inbufsize, &output, &outbufsize); *output = 0; return r; } }; IConv converter("UTF-8", "CP437"); char display_line(const char *line) { char input[1024]; char output[1024]; int len; strcpy(input, line); converter.convert(input, output, sizeof(output)); printf("%s\n", output); } int main() { int x; int size = (sizeof(skull) / sizeof(char *)); for (x = 0; x < size; x++) { display_line(skull[x]); } fflush(stdout); getchar(); printf("\n\n"); size = (sizeof(skullblink) / sizeof(char *)); for (x = 0; x < size; x++) { display_line(skullblink[x]); } fflush(stdout); getchar(); printf("\n\n"); size = (sizeof(ghead) / sizeof(char *)); for (x = 0; x < size; x++) { display_line(ghead[x]); } fflush(stdout); getchar(); printf("\n\n"); size = (sizeof(ghost) / sizeof(char *)); for (x = 0; x < size; x++) { display_line(ghost[x]); } fflush(stdout); getchar(); printf("\n\n"); size = (sizeof(wolf) / sizeof(char *)); for (x = 0; x < size; x++) { display_line(wolf[x]); } fflush(stdout); getchar(); printf("\n\n"); size = (sizeof(panther) / sizeof(char *)); for (x = 0; x < size; x++) { display_line(panther[x]); } fflush(stdout); getchar(); printf("\n\n"); size = (sizeof(bat) / sizeof(char *)); for (x = 0; x < size; x++) { display_line(bat[x]); } fflush(stdout); getchar(); printf("\n\n"); return 0; }