commit ea478e19f105f510281f96fd094f686e933b6363
parent 6fe941eed206de330a3d0a9d95a58c96d346d920
Author: William Morgan <wmorgan-sup@masanjin.net>
Date: Mon, 23 Mar 2009 10:56:32 -0400
Merge branch 'encoding-misspellings' into next
Diffstat:
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/bin/sup-tweak-labels b/bin/sup-tweak-labels
@@ -71,7 +71,7 @@ begin
end.map { |s| s.id }
Trollop::die "nothing to do: no sources" if source_ids.empty?
- query = "+(" + source_ids.map { |id| "source_id:#{id}" }.join(" ") + ")"
+ query = "+(" + source_ids.map { |id| "source_id:#{id}" }.join(" OR ") + ")"
if add_labels.empty?
## if all we're doing is removing labels, we can further restrict the
## query to only messages with those labels
diff --git a/lib/sup/util.rb b/lib/sup/util.rb
@@ -620,11 +620,12 @@ end
class Iconv
def self.easy_decode target, charset, text
- return text if charset =~ /^(x-unknown|unknown[-_]?8bit|ascii[-_]?7[-_]?bit)$/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 /unicode[-_]1[-_]1[-_]utf[-_]7/i: "utf-7"
+ 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