By using GMime's set_best_content_encoding(), Geary will use an appropriate Content-Transfer-Encoding for the block of data being transmitted (plain body, HTML body, attachments). Using this also deals with encoding long line lengths properly. Note that #6842 is still a problem (properly encoding emails forwarded as attachments).
This commit is contained in:
parent
709caaf2f6
commit
7de9b2d96c
2 changed files with 7 additions and 3 deletions
|
|
@ -253,8 +253,8 @@ public string html_to_flowed_text(WebKit.DOM.Document doc) {
|
|||
}
|
||||
}
|
||||
|
||||
// Reassemble plain text out of parts
|
||||
string doctext = resolve_nesting(doc.get_body().get_inner_text(), bqtexts);
|
||||
// Reassemble plain text out of parts, replace non-breaking space with regular space
|
||||
string doctext = resolve_nesting(doc.get_body().get_inner_text(), bqtexts).replace("\xc2\xa0", " ");
|
||||
|
||||
// Reassemble DOM
|
||||
for (int i = 0; i < nbq; i++) {
|
||||
|
|
|
|||
|
|
@ -119,6 +119,8 @@ public class Geary.RFC822.Message : BaseObject {
|
|||
body_text = new GMime.Part();
|
||||
body_text.set_content_type(new GMime.ContentType.from_string("text/plain; charset=utf-8; format=flowed"));
|
||||
body_text.set_content_object(content);
|
||||
body_text.set_content_encoding(body_text.get_best_content_encoding(
|
||||
GMime.EncodingConstraint.7BIT));
|
||||
}
|
||||
|
||||
// Body: HTML format (also optional)
|
||||
|
|
@ -131,6 +133,8 @@ public class Geary.RFC822.Message : BaseObject {
|
|||
body_html = new GMime.Part();
|
||||
body_html.set_content_type(new GMime.ContentType.from_string("text/html; charset=utf-8"));
|
||||
body_html.set_content_object(content);
|
||||
body_html.set_content_encoding(body_html.get_best_content_encoding(
|
||||
GMime.EncodingConstraint.7BIT));
|
||||
}
|
||||
|
||||
// Build the message's mime part.
|
||||
|
|
@ -245,7 +249,7 @@ public class Geary.RFC822.Message : BaseObject {
|
|||
part.set_content_object(new GMime.DataWrapper.with_stream(stream, GMime.ContentEncoding.BINARY));
|
||||
|
||||
// This encoding is the "Content-Transfer-Encoding", which GMime automatically converts to.
|
||||
part.set_content_encoding(GMime.ContentEncoding.BASE64);
|
||||
part.set_content_encoding(part.get_best_content_encoding(GMime.EncodingConstraint.7BIT));
|
||||
|
||||
return part;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue