mirror of https://github.com/djcb/mu.git
Merge branch 'master' into unify-msg-msgiter
This commit is contained in:
commit
eabd4e2e61
|
@ -175,10 +175,11 @@ mu_contacts_foreach (MuContacts *self, MuContactsForeachFunc func,
|
||||||
GError *err;
|
GError *err;
|
||||||
err = NULL;
|
err = NULL;
|
||||||
ecdata._rx = g_regex_new
|
ecdata._rx = g_regex_new
|
||||||
(pattern, G_REGEX_CASELESS|G_REGEX_EXTENDED|G_REGEX_OPTIMIZE,
|
(pattern, G_REGEX_CASELESS|G_REGEX_OPTIMIZE,
|
||||||
0, &err);
|
0, &err);
|
||||||
if (!ecdata._rx) {
|
if (!ecdata._rx) {
|
||||||
g_warning ("error in regexp '%s': %s", pattern, err->message);
|
g_warning ("error in regexp '%s': %s",
|
||||||
|
pattern, err->message);
|
||||||
g_error_free (err);
|
g_error_free (err);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
14
src/mu-msg.c
14
src/mu-msg.c
|
@ -608,8 +608,8 @@ get_body_cb (GMimeObject *parent, GMimeObject *part, GetBodyData *data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* turn \0-terminated buf into ascii (which is a utf8 subset);
|
/* turn \0-terminated buf into ascii (which is a utf8 subset); convert
|
||||||
* convert any non-ascii into '.'
|
* any non-ascii into '.'
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
asciify (char *buf)
|
asciify (char *buf)
|
||||||
|
@ -650,11 +650,11 @@ convert_to_utf8 (GMimePart *part, char *buffer)
|
||||||
{
|
{
|
||||||
GMimeContentType *ctype;
|
GMimeContentType *ctype;
|
||||||
const char* charset;
|
const char* charset;
|
||||||
char *cur;
|
unsigned char *cur;
|
||||||
|
|
||||||
/* optimization: if the buffer is plain ascii, no conversion
|
/* optimization: if the buffer is plain ascii, no conversion
|
||||||
* is done... */
|
* is done... */
|
||||||
for (cur = buffer; *cur && *cur < 0x80; ++cur);
|
for (cur = (unsigned char*)buffer; *cur && *cur < 0x80; ++cur);
|
||||||
if (*cur == '\0')
|
if (*cur == '\0')
|
||||||
return buffer;
|
return buffer;
|
||||||
|
|
||||||
|
@ -674,9 +674,9 @@ convert_to_utf8 (GMimePart *part, char *buffer)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* hmmm.... no charset at all, or conversion failed; ugly hack:
|
/* hmmm.... no charset at all, or conversion failed; ugly
|
||||||
* replace all non-ascii chars with '.' instead... TODO: come up
|
* hack: replace all non-ascii chars with '.'
|
||||||
* with something better */
|
* instead... TODO: come up with something better */
|
||||||
asciify (buffer);
|
asciify (buffer);
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue