format_string(str) private

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/net/imap.rb, line 2469
      def format_string(str)
        case str
        when ""
          return '""'
        when /[\x80-\xff\r\n]/n
          # literal
          return "{" + str.length.to_s + "}" + CRLF + str
        when /[(){ \x00-\x1f\x7f%*"\\]/n
          # quoted string
          return '"' + str.gsub(/["\\]/n, "\\\\\\&") + '"'
        else
          # atom
          return str
        end
      end
Register or log in to add new notes.