#include #include #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "wv.h" #include "iconv.h" #include "iconv_internal.h" typedef struct _convertt { char *name; wvConvertToUnicode proc; }convertt; #define NOINPUTS 9 /* #define NOINPUTS 13 */ convertt inputs[NOINPUTS] = { { "CP874", wvConvert874ToUnicode }, /* { "CP932", wvConvert932ToUnicode }, { "CP936", wvConvert936ToUnicode }, { "CP949", wvConvert949ToUnicode }, { "CP950", wvConvert950ToUnicode }, */ { "CP1250", wvConvert1250ToUnicode }, { "CP1251", wvConvert1251ToUnicode }, { "CP1252", wvConvert1252ToUnicode }, { "CP1253", wvConvert1253ToUnicode }, { "CP1254", wvConvert1254ToUnicode }, { "CP1255", wvConvert1255ToUnicode }, { "CP1256", wvConvert1256ToUnicode }, { "CP1257", wvConvert1257ToUnicode } }; #define NOOUTPUTS 4 convertt outputs[NOOUTPUTS] = { { "utf-8", wvConvertUnicodeToUTF_8}, { "iso-8859-15", wvConvertUnicodeToiso8859_15}, { "koi8-r", wvConvertUnicodeToKOI8_R}, { "tis-620", wvConvertUnicodeToTIS620} }; iconv_t iconv_open (const char *tocode, const char *fromcode) { int i; /* if converting from unicode */ if (!(strcasecmp(fromcode,"UCS-2"))) { for (i=0;i