+2004-08-21 [colin] 0.9.12cvs66.3
+
+ * src/compose.c
+ * src/codeconv.c
+ Fix warnings
+ Remove encoding hacks
+ Fix bug 575 (Strange character messes up message)
+ Don't display conversion error when drafting
+
2004-08-21 [paul] 0.9.12cvs66.2
* src/prefs_account.c
( cvs diff -u -r 1.9.2.5 -r 1.9.2.6 src/common/ssl.c; cvs diff -u -r 1.1.2.1 -r 1.1.2.3 src/plugins/pgpmime/plugin.c; ) > 0.9.12cvs65.1.patchset
( cvs diff -u -r 1.65.2.10 -r 1.65.2.11 src/codeconv.c; ) > 0.9.12cvs66.1.patchset
( cvs diff -u -r 1.105.2.7 -r 1.105.2.8 src/prefs_account.c; ) > 0.9.12cvs66.2.patchset
+( cvs diff -u -r 1.382.2.40 -r 1.382.2.41 src/compose.c; cvs diff -u -r 1.65.2.11 -r 1.65.2.12 src/codeconv.c; ) > 0.9.12cvs66.3.patchset
BINARY_AGE=0
EXTRA_VERSION=66
EXTRA_RELEASE=
-EXTRA_GTK2_VERSION=.2
+EXTRA_GTK2_VERSION=.3
if test \( $EXTRA_VERSION -eq 0 \) -o \( "x$EXTRA_RELEASE" != "x" \); then
VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}${EXTRA_RELEASE}${EXTRA_GTK2_VERSION}
* whether iconv is sitting below, or something else */
gchar *outbuf;
gsize read_len, written_len;
- gchar *src_code = conv_get_outgoing_charset_str();
- gchar *dest_code = conv_get_current_charset_str();
+ gchar *src_code = (char *)conv_get_outgoing_charset_str();
+ gchar *dest_code = (char *)conv_get_current_charset_str();
if (isrc_code)
- src_code = isrc_code;
+ src_code = (char *)isrc_code;
if (idest_code)
- dest_code = idest_code;
+ dest_code = (char *)idest_code;
/* don't convert if current codeset is US-ASCII */
if (!strcasecmp(dest_code, CS_US_ASCII))
outbuf = g_convert(inbuf, strlen(inbuf), dest_code, src_code,
&read_len, &written_len, NULL);
- if (outbuf == NULL && strcasecmp(src_code, CS_ISO_8859_15))
- /* also try iso-8859-15 */
- outbuf = conv_iconv_strdup(inbuf, CS_ISO_8859_15, dest_code);
if (outbuf == NULL)
g_warning(_("Valid locale type set? (Currently: %s to %s)\n"),
src_code, dest_code);
const guchar *srcp = src;
guchar *destp = dest;
gboolean use_base64;
-
+ gchar *testbuf;
+
if (MB_CUR_MAX > 1) {
use_base64 = TRUE;
mimesep_enc = "?B?";
if (!strcmp(out_encoding, CS_US_ASCII))
out_encoding = CS_ISO_8859_1;
+ testbuf = conv_codeset_strdup(src, cur_encoding, out_encoding);
+
+ if (testbuf != NULL)
+ g_free(testbuf);
+ else
+ out_encoding = CS_UTF_8;
+
mimestr_len = strlen(MIMESEP_BEGIN) + strlen(out_encoding) +
strlen(mimesep_enc) + strlen(MIMESEP_END);
buf = conv_codeset_strdup(chars, src_codeset, out_codeset);
if (!buf) {
- AlertValue aval;
+ AlertValue aval = G_ALERTDEFAULT;
gchar *msg;
- msg = g_strdup_printf(_("Can't convert the character encoding of the message from\n"
+ if (!is_draft) {
+ msg = g_strdup_printf(_("Can't convert the character encoding of the message from\n"
"%s to %s.\n"
"Send it anyway?"), src_codeset, out_codeset);
- aval = alertpanel_with_type
- (_("Error"), msg, _("Yes"), _("+No"), NULL, NULL, ALERT_ERROR);
- g_free(msg);
-
+ aval = alertpanel_with_type
+ (_("Error"), msg, _("Yes"), _("+No"), NULL, NULL, ALERT_ERROR);
+ g_free(msg);
+ }
+
if (aval != G_ALERTDEFAULT) {
g_free(chars);
fclose(fp);
if (!g_strcasecmp(trans_hdr, headerentryname)) {
const gchar *entstr = gtk_entry_get_text(GTK_ENTRY(headerentry->entry));
- gchar *tmpstr = conv_codeset_strdup(entstr, CS_UTF_8, conv_get_current_charset_str());
- Xstrdup_a(str, tmpstr, return -1);
+ Xstrdup_a(str, entstr, return -1);
g_strstrip(str);
if (str[0] != '\0') {
if (write_header)
g_string_append(headerstr, str);
write_header = TRUE;
}
- g_free(tmpstr);
}
}
if (write_header) {
for ( tmp = file_list; tmp; tmp = tmp->next) {
gchar *file = (gchar *) tmp->data;
gchar *filedup = g_strdup(file);
- gchar *shortfile;
+ const gchar *shortfile = g_basename(filedup);
ComposeInsertResult res;
res = compose_insert_file(compose, file);
- shortfile = g_basename(filedup);
if (res == COMPOSE_INSERT_READ_ERROR) {
alertpanel_error(_("File '%s' could not be read."), shortfile);
} else if (res == COMPOSE_INSERT_INVALID_CHARACTER) {