]> git.notmuchmail.org Git - sup/blobdiff - lib/sup/util.rb
Merge branch 'dont-canonicalize-email-addresses' into next
[sup] / lib / sup / util.rb
index f3db95ddaf6b33da668ed14dc0473619137e1439..dbcffcc5951356dec2c533393ba100b4071b8eac 100644 (file)
@@ -620,10 +620,12 @@ end
 
 class Iconv
   def self.easy_decode target, charset, text
-    return text if charset =~ /^(x-unknown|unknown-8bit)$/i
+    return text if charset =~ /^(x-unknown|unknown[-_ ]?8bit|ascii[-_ ]?7[-_ ]?bit)$/i
     charset = case charset
-                when /UTF[-_]?8/i: "utf-8"
-                when /(iso[-_])?latin[-_]?1$/i: "ISO-8859-1"
+                when /UTF[-_ ]?8/i: "utf-8"
+                when /(iso[-_ ])?latin[-_ ]?1$/i: "ISO-8859-1"
+                when /iso[-_ ]?8859[-_ ]?15/i: 'ISO-8859-15'
+                when /unicode[-_ ]1[-_ ]1[-_ ]utf[-_]7/i: "utf-7"
                 else charset
               end