class Mail::Encodings::QuotedPrintable

def self.decode(str)

Decode the string from Quoted-Printable
def self.decode(str)
  str.unpack("M*").first
end

def self.encode(str)

def self.encode(str)
  str.gsub( /[^a-z ]/i ) { quoted_printable_encode($&) }
end

def self.quoted_printable_encode(character)

account multi-byte characters (if executing with $KCODE="u", for instance)
Convert the given character to quoted printable format, taking into
def self.quoted_printable_encode(character)
  result = ""
  character.each_byte { |b| result << "=%02X" % b }
  result
end