method
format_string
format_string(str)
private
Hide source
# File lib/net/imap.rb, line 2499 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