[Users] [Bug 2173] Message subject encoding is assumed ISO 8859-1 instead of using charset in Content-Type header

noreply at thewildbeast.co.uk noreply at thewildbeast.co.uk
Sun Sep 16 23:08:18 CEST 2012


--- Comment #8 from Andrey Gursky  2012-09-16 23:08:17 ---
If the received message contains no properly formatted subject field, that
misses the used encoding, it is essential to guess one. And the best suggestion
for guess is try to look in one in Content-Type. If one was found, it is
obviously to assume that the same has been used also for the subject. So this
one should be made default_encoding for all subsequent calls to
conv_unmime_header(..., const gchar   *default_encoding, ...). The argument is
just for this puprose and now is being ignored at all.

PLEASE, make use of it.

For example how this done in sylpheed:
MsgInfo *procheader_parse_stream(FILE *fp, MsgFlags flags, gboolean full)
    gchar *charset = NULL;
        case H_SUBJECT:
            if (msginfo->subject) break;
            subject = g_strdup(hp);
        case H_CONTENT_TYPE:
            if (!g_ascii_strncasecmp(hp, "multipart", 9)) {
                MSG_SET_TMP_FLAGS(msginfo->flags, MSG_MIME);
            } else if (!charset) {
                    (hp, NULL, &charset, NULL, NULL);
    if (subject) {
        msginfo->subject = conv_unmime_header(subject, charset);
        subst_control(msginfo->subject, ' ');


Configure bugmail: http://www.thewildbeast.co.uk/claws-mail/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

More information about the Users mailing list