# File lib/mailfactory.rb, line 411
  def quoted_printable_encode_header(text)
    text.scan(/./u).map do |char|
      (char[0] < 128 and char[0] != 61) ? # 61 is ascii '='
        char :
        '=%X' % char[0]
    end.join('').
        chomp.
        gsub(/=$/,'').
        gsub('?', '=3F').
        gsub('_', '=5F').
        gsub(/ /, '_')
  end