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