[Xfce4-commits] <postler:master> Adapt the Korean encoding quirk to work again
Christian Dywan
noreply at xfce.org
Sun Jul 18 20:38:02 CEST 2010
Updating branch refs/heads/master
to 19406c01840b840ceb69aee5ebb904c1d32b9e0e (commit)
from d2fd92ed91a13d86b879a1553fa0a011d3852ab8 (commit)
commit 19406c01840b840ceb69aee5ebb904c1d32b9e0e
Author: Christian Dywan <christian at twotoasts.de>
Date: Sun Jul 18 20:12:16 2010 +0200
Adapt the Korean encoding quirk to work again
postler/postler-messages.vala | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/postler/postler-messages.vala b/postler/postler-messages.vala
index 2b53951..47a7895 100644
--- a/postler/postler-messages.vala
+++ b/postler/postler-messages.vala
@@ -251,8 +251,9 @@ public class Postler.Messages : Gtk.TreeView {
token++;
charset = encoded[token1:token].up ();
/* Encoding aliases */
- if (charset == "KS_C_5601-1987")
- charset = "CP949";
+ if (charset == "?KS_C_5601-1987")
+ charset = "?CP949";
+
token++;
unichar encoding = encoded[token].toupper ();
if (encoding != 'Q' && encoding != 'B')
@@ -277,7 +278,7 @@ public class Postler.Messages : Gtk.TreeView {
(pieces[1] != null ? pieces[1] : "");
}
catch (GLib.ConvertError error) {
- GLib.message (_("Failed to convert \"%s\": %s"), encoded, error.message);
+ GLib.warning (_("Failed to convert \"%s\": %s"), encoded, error.message);
return encoded.substring (0, token1 - 1)
+ pieces[0] + (pieces[1] != null ? pieces[1] : "");
}
@@ -289,6 +290,7 @@ public class Postler.Messages : Gtk.TreeView {
string[] pieces = encoded.strip ().split ("?=");
if (pieces == null || pieces[0] == null)
return encoded;
+
var decoded = new GLib.StringBuilder ();
foreach (var piece in pieces)
decoded.append (decode_piece (piece, out charset));
More information about the Xfce4-commits
mailing list