[Xfce4-commits] <postler:master> Explicitly check if there's a charset, default to ISO-8859-1

Christian Dywan noreply at xfce.org
Mon May 31 20:00:06 CEST 2010


Updating branch refs/heads/master
         to 1e8f8e88b6a57da4e89184573499382bb95f87a2 (commit)
       from 1a08558f8c3ec071b7746c539be20c08d9ca18f1 (commit)

commit 1e8f8e88b6a57da4e89184573499382bb95f87a2
Author: Christian Dywan <christian at twotoasts.de>
Date:   Mon May 31 19:55:53 2010 +0200

    Explicitly check if there's a charset, default to ISO-8859-1

 postler/postler-content.vala |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/postler/postler-content.vala b/postler/postler-content.vala
index f36560c..806491d 100644
--- a/postler/postler-content.vala
+++ b/postler/postler-content.vala
@@ -17,6 +17,8 @@ struct Postler.EmoticonMapping {
 }
 
 public class Postler.Content : WebKit.WebView {
+    public string default_charset { get; set; default = "ISO-8859-1"; }
+
     public string? last_location { get; set; }
     public string? subject { get; set; }
     public string? reply_to { get; set; }
@@ -148,7 +150,7 @@ public class Postler.Content : WebKit.WebView {
             string line;
             string content_type = null;
             string mime_type = "text/plain";
-            string charset = "UTF-8";
+            string charset = null;
             string[] parts;
             GLib.StringBuilder body;
 
@@ -165,6 +167,9 @@ public class Postler.Content : WebKit.WebView {
                     mime_type = parts[0];
                     charset = parts[1];
                 }
+                if (charset == null)
+                    charset = default_charset;
+
                 /* FIXME view_source_mode requires WebKitGTK+ 1.1.something */
                 set_view_source_mode (true);
                 load_string (body.str, mime_type, charset, "about:blank");
@@ -228,6 +233,9 @@ public class Postler.Content : WebKit.WebView {
                     x_mailer = format_x_mailer (parts[1]);
             }
 
+            if (charset == null)
+                charset = default_charset;
+
             reply_to = reply != "" ? reply : from;
             if (carbon_copy != "")
                 reply_to_all = reply_to + "," + carbon_copy;



More information about the Xfce4-commits mailing list