instance method
charset
Ruby on Rails 2.2.3
Since v2.2.3 Last seen in v2.3.18Available in: v2.2.3 v2.3.18
Signature
charset( default = nil )
Returns the character set of the email. Returns nil if no encoding set or returns whatever default you pass as a parameter - note passing the parameter does NOT change the mail object in any way.
Example:
mail = TMail::Mail.load("path_to/utf8_email") mail.charset #=> "UTF-8" mail = TMail::Mail.new mail.charset #=> nil mail.charset("US-ASCII") #=> "US-ASCII"
Parameters
-
defaultopt = nil
Source
# File actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/interface.rb, line 842
def charset( default = nil )
if h = @header['content-type']
h['charset'] or default
else
default
end
end
Defined in actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/interface.rb line 842
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in TMail::Mail