Permalink
Browse files

try and be a little more restrictive as to what is allowed as UTF-xxxx

  • Loading branch information...
1 parent 6a0bd67 commit f45e95675052821c7e1b8fdb54dcfad233d1ff14 @scsmith scsmith committed Feb 14, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/mail/version_specific/ruby_1_9.rb
@@ -94,8 +94,8 @@ def Ruby19.fix_encoding(encoding)
when /iso-?(\d{4})-?(\w{1,2})/i then return "ISO-#{$1}-#{$2}"
# "ISO-2022-JP-KDDI" and alike
when /iso-?(\d{4})-?(\w{1,2})-?(\w*)/i then return "ISO-#{$1}-#{$2}-#{$3}"
- # utf-8 and alike
- when /utf-?(.*)/i then return "UTF-#{$1}"
+ # UTF-8, UTF-32BE and alike
+ when /utf-?(\d{1,2})?(\w{1,2})/i then return "UTF-#{$1}#{$2}"
# Windows-1252 and alike
when /Windows-?(.*)/i then return "Windows-#{$1}"
#more aliases to be added if needed

0 comments on commit f45e956

Please sign in to comment.