Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: nicolas.pouillard@gmail.com (Nicolas Pouillard)
Subject: [sup-talk] [PATCH] decoding: handle more misspellings, in particular ISO-8859-15
Date: Mon, 16 Mar 2009 19:56:17 +0100	[thread overview]
Message-ID: <1237229771-sup-9316@ausone.local> (raw)

Resent...

---
 lib/sup/util.rb |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/lib/sup/util.rb b/lib/sup/util.rb
index fc62532..dbcffcc 100644
--- 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
 

-- 
Nicolas Pouillard


             reply	other threads:[~2009-03-16 18:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-16 18:56 Nicolas Pouillard [this message]
2009-03-23 14:57 ` William Morgan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1237229771-sup-9316@ausone.local \
    --to=nicolas.pouillard@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox