From: Paul Mangan Date: Wed, 20 Apr 2005 04:14:07 +0000 (+0000) Subject: 2005-04-20 [paul] 1.9.6cvs43 X-Git-Tag: rel_1_9_9~17 X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=commitdiff_plain;h=f6be1f680792f3ee61cd36ffa94528684b505369 2005-04-20 [paul] 1.9.6cvs43 * src/codeconv.c complete 1.9.6cvs42's sync: Fallback to GBK if "X-GBK" is passed (thanks to SuperMMX) --- diff --git a/ChangeLog-gtk2.claws b/ChangeLog-gtk2.claws index 437553860..ace64d773 100644 --- a/ChangeLog-gtk2.claws +++ b/ChangeLog-gtk2.claws @@ -1,3 +1,9 @@ +2005-04-20 [paul] 1.9.6cvs43 + + * src/codeconv.c + complete 1.9.6cvs42's sync: + Fallback to GBK if "X-GBK" is passed (thanks to SuperMMX) + 2005-04-19 [paul] 1.9.6cvs42 sync with main: @@ -10,8 +16,7 @@ * src/mainwindow.c * src/messageview.c * src/prefs_common.c - support GBK encoding. Fallback to GBK if "X-GBK" - is passed (thanks to SuperMMX) + support GBK encoding. * src/common/session.c * src/common/session.h use separate buffer for large data to be sent, diff --git a/PATCHSETS b/PATCHSETS index 87acf0e78..c630ffb07 100644 --- a/PATCHSETS +++ b/PATCHSETS @@ -459,3 +459,4 @@ ( cvs diff -u -r 1.382.2.117 -r 1.382.2.118 src/compose.c; ) > 1.9.6cvs40.patchset ( cvs diff -u -r 1.18.2.7 -r 1.18.2.8 src/jpilot.c; ) > 1.9.6cvs41.patchset ( cvs diff -u -r 1.12.2.21 -r 1.12.2.22 src/action.c; cvs diff -u -r 1.65.2.26 -r 1.65.2.27 src/codeconv.c; cvs diff -u -r 1.15.2.6 -r 1.15.2.7 src/codeconv.h; cvs diff -u -r 1.274.2.34 -r 1.274.2.35 src/mainwindow.c; cvs diff -u -r 1.94.2.49 -r 1.94.2.50 src/messageview.c; cvs diff -u -r 1.204.2.34 -r 1.204.2.35 src/prefs_common.c; cvs diff -u -r 1.23.2.4 -r 1.23.2.5 src/common/session.c; cvs diff -u -r 1.8.2.2 -r 1.8.2.3 src/common/session.h; ) > 1.9.6cvs42.patchset +( cvs diff -u -r 1.1.2.498 -r 1.1.2.499 ChangeLog-gtk2.claws; cvs diff -u -r 1.65.2.27 -r 1.65.2.28 src/codeconv.c; ) > 1.9.6cvs43.patchset diff --git a/configure.ac b/configure.ac index 5ecf4b800..3aff40a71 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ MINOR_VERSION=9 MICRO_VERSION=6 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=42 +EXTRA_VERSION=43 EXTRA_RELEASE= EXTRA_GTK2_VERSION= diff --git a/src/codeconv.c b/src/codeconv.c index dbfa47761..71f8804b8 100644 --- a/src/codeconv.c +++ b/src/codeconv.c @@ -825,10 +825,24 @@ static void conv_noconv(gchar *outbuf, gint outlen, const gchar *inbuf) strncpy2(outbuf, inbuf, outlen); } +static const gchar * +conv_get_fallback_for_private_encoding(const gchar *encoding) +{ + if (encoding && (encoding[0] == 'X' || encoding[0] == 'x') && + encoding[1] == '-') { + if (!g_ascii_strcasecmp(encoding, CS_X_GBK)) + return CS_GBK; + } + + return encoding; +} + CodeConverter *conv_code_converter_new(const gchar *src_charset) { CodeConverter *conv; + src_charset = conv_get_fallback_for_private_encoding(src_charset); + conv = g_new0(CodeConverter, 1); conv->code_conv_func = conv_get_code_conv_func(src_charset, NULL); conv->charset_str = g_strdup(src_charset); @@ -870,6 +884,7 @@ gchar *conv_codeset_strdup(const gchar *inbuf, size_t len; CodeConvFunc conv_func; + src_code = conv_get_fallback_for_private_encoding(src_code); conv_func = conv_get_code_conv_func(src_code, dest_code); if (conv_func != conv_noconv) { len = (strlen(inbuf) + 1) * 3;