# File lib/mail/encodings.rb, line 224
    def Encodings.q_value_encode(str, encoding = nil)
      return str if str.to_s.ascii_only?
      string, encoding = RubyVer.q_value_encode(str, encoding)
      string.gsub!("=\r\n", '') # We already have limited the string to the length we want
      map_lines(string) do |str|
        "=?#{encoding}?Q?#{str.chomp.gsub(/ /, '_')}?="
      end.join(" ")
    end