From 7d736933241fe2511f302b3460b67120bdd2591b Mon Sep 17 00:00:00 2001 From: Colin Leroy Date: Sat, 22 Oct 2005 14:00:49 +0000 Subject: [PATCH] 2005-10-22 [colin] 1.9.15cvs92 * src/codeconv.c try to convert using locale (apart utf8) if necessary --- ChangeLog-gtk2.claws | 5 +++++ PATCHSETS | 1 + configure.ac | 2 +- src/codeconv.c | 13 ++++++++++++- 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/ChangeLog-gtk2.claws b/ChangeLog-gtk2.claws index 71881649d..9a9f53ba4 100644 --- a/ChangeLog-gtk2.claws +++ b/ChangeLog-gtk2.claws @@ -1,3 +1,8 @@ +2005-10-22 [colin] 1.9.15cvs92 + + * src/codeconv.c + try to convert using locale (apart utf8) if necessary + 2005-10-22 [colin] 1.9.15cvs91 * src/pixmaps/new.xpm diff --git a/PATCHSETS b/PATCHSETS index 903644d6c..f8c3ea727 100644 --- a/PATCHSETS +++ b/PATCHSETS @@ -928,3 +928,4 @@ ( cvs diff -u -r 1.59.2.25 -r 1.59.2.26 src/prefs_filtering.c; cvs diff -u -r 1.96.2.81 -r 1.96.2.82 src/textview.c; cvs diff -u -r 1.1.2.7 -r 1.1.2.8 src/plugins/pgpinline/pgpinline.c; ) > 1.9.15cvs89.patchset ( cvs diff -u -r 1.382.2.186 -r 1.382.2.187 src/compose.c; ) > 1.9.15cvs90.patchset ( cvs diff -u -r 1.2.16.1 -r 1.2.16.2 src/pixmaps/new.xpm; cvs diff -u -r 1.2.16.2 -r 1.2.16.3 src/pixmaps/unread.xpm; ) > 1.9.15cvs91.patchset +( cvs diff -u -r 1.65.2.41 -r 1.65.2.42 src/codeconv.c; ) > 1.9.15cvs92.patchset diff --git a/configure.ac b/configure.ac index 18c663cd2..0d77ed211 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ MINOR_VERSION=9 MICRO_VERSION=15 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=91 +EXTRA_VERSION=92 EXTRA_RELEASE= EXTRA_GTK2_VERSION= diff --git a/src/codeconv.c b/src/codeconv.c index d1226ee35..e3a9a834a 100644 --- a/src/codeconv.c +++ b/src/codeconv.c @@ -677,14 +677,25 @@ void conv_localetodisp(gchar *outbuf, gint outlen, const gchar *inbuf) { gchar *tmpstr; + codeconv_set_strict(TRUE); tmpstr = conv_iconv_strdup(inbuf, conv_get_locale_charset_str(), CS_INTERNAL); + codeconv_set_strict(FALSE); if (tmpstr && g_utf8_validate(tmpstr, -1, NULL)) { strncpy2(outbuf, tmpstr, outlen); g_free(tmpstr); + return; } else if (tmpstr && !g_utf8_validate(tmpstr, -1, NULL)) { g_free(tmpstr); - conv_utf8todisp(outbuf, outlen, inbuf); + codeconv_set_strict(TRUE); + tmpstr = conv_iconv_strdup(inbuf, + conv_get_locale_charset_str_no_utf8(), + CS_INTERNAL); + codeconv_set_strict(FALSE); + } + if (tmpstr && g_utf8_validate(tmpstr, -1, NULL)) { + strncpy2(outbuf, tmpstr, outlen); + g_free(tmpstr); } else conv_utf8todisp(outbuf, outlen, inbuf); } -- 2.25.1