+2003-03-03
+
+ * src/codeconv.c: fixed UTF-8 locale support.
+ conv_get_code_conv_func(): return conv_noconv if locale encoding
+ is UTF-8. Return conv_latintodisp on ISO-8859-* to locale encoding
+ conversion.
+ conv_convert(): call conv_iconv_strdup() instead of
+ conv_codeset_strdup().
+ conv_codeset_strdup(): moved some codes into conv_iconv_strdup().
+
2003-02-28
* src/prefs_account.[ch]: added an option to use command output for
+2003-03-03
+
+ * src/codeconv.c: UTF-8 locale Âбþ¤ò½¤Àµ¡£
+ conv_get_code_conv_func(): locale ¤Î¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤¬ UTF-8 ¤Î
+ ¾ì¹ç¤Ï conv_noconv ¤òÊÖ¤¹¤è¤¦¤Ë¤·¤¿¡£ ISO-8859-* ¤«¤é locale
+ ¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤Ø¤ÎÊÑ´¹¤Î¾ì¹ç¤Ï conv_latintodisp ¤òÊÖ¤¹¤è¤¦¤Ë¤·¤¿¡£
+ conv_convert(): conv_codeset_strdup() ¤ÎÂå¤ï¤ê¤Ë conv_iconv_strdup()
+ ¤ò¸Æ¤Ö¤è¤¦¤Ë¤·¤¿¡£
+ conv_codeset_strdup(): °ìÉô¤Î¥³¡¼¥É¤ò conv_iconv_strdup() ¤Ë°ÜÆ°¡£
+
2003-02-28
* src/prefs_account.[ch]: ½ð̾¤Ë¥³¥Þ¥ó¥É¤Î½ÐÎϤò»ÈÍѤ¹¤ë¥ª¥×¥·¥ç¥ó
else {
gchar *str;
- str = conv_codeset_strdup(inbuf, conv->charset_str, NULL);
+ str = conv_iconv_strdup(inbuf, conv->charset_str, NULL);
if (!str)
return -1;
else {
}
#if HAVE_ICONV
- if (!src_code)
- src_code = conv_get_outgoing_charset_str();
- if (!dest_code)
- dest_code = conv_get_current_charset_str();
-
- /* don't convert if current codeset is US-ASCII */
- if (!strcasecmp(dest_code, CS_US_ASCII))
- return g_strdup(inbuf);
-
- /* don't convert if src and dest codeset are identical */
- if (!strcasecmp(src_code, dest_code))
- return g_strdup(inbuf);
-
return conv_iconv_strdup(inbuf, src_code, dest_code);
#else
return g_strdup(inbuf);
if (dest_charset == C_US_ASCII)
return conv_ustodisp;
+ else if (dest_charset == C_UTF_8 ||
+ (dest_charset == C_AUTO &&
+ conv_get_current_charset() == C_UTF_8))
+ return conv_noconv;
switch (src_charset) {
case C_ISO_2022_JP:
code_conv = conv_ustodisp;
break;
case C_ISO_8859_1:
-#if !HAVE_ICONV
case C_ISO_8859_2:
case C_ISO_8859_4:
case C_ISO_8859_5:
case C_ISO_8859_11:
case C_ISO_8859_13:
case C_ISO_8859_15:
-#endif
if (dest_charset == C_AUTO)
code_conv = conv_latintodisp;
break;
gint out_left;
gint n_conv;
+ if (!src_code)
+ src_code = conv_get_outgoing_charset_str();
+ if (!dest_code)
+ dest_code = conv_get_current_charset_str();
+
+ /* don't convert if current codeset is US-ASCII */
+ if (!strcasecmp(dest_code, CS_US_ASCII))
+ return g_strdup(inbuf);
+
+ /* don't convert if src and dest codeset are identical */
+ if (!strcasecmp(src_code, dest_code))
+ return g_strdup(inbuf);
+
cd = iconv_open(dest_code, src_code);
if (cd == (iconv_t)-1)
return NULL;