+void conv_anytoutf8(gchar *outbuf, gint outlen, const gchar *inbuf)
+{
+ gchar *tmpstr = NULL;
+
+ switch (conv_guess_ja_encoding(inbuf)) {
+ case C_ISO_2022_JP:
+ tmpstr = conv_codeset_strdup(inbuf, CS_ISO_2022_JP, CS_UTF_8);
+ strncpy2(outbuf, tmpstr, outlen);
+ g_free(tmpstr);
+ break;
+ case C_SHIFT_JIS:
+ tmpstr = conv_codeset_strdup(inbuf, CS_SHIFT_JIS, CS_UTF_8);
+ strncpy2(outbuf, tmpstr, outlen);
+ g_free(tmpstr);
+ break;
+ case C_EUC_JP:
+ tmpstr = conv_codeset_strdup(inbuf, CS_EUC_JP, CS_UTF_8);
+ strncpy2(outbuf, tmpstr, outlen);
+ g_free(tmpstr);
+ break;
+ default:
+ strncpy2(outbuf, inbuf, outlen);
+ break;
+ }
+}
+