instance method charset

Ruby on Rails 2.3.18

Since v2.2.3 Last seen in v2.3.18

Available 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

default opt = nil
Source
# File actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/interface.rb, line 864
    def charset( default = nil )
      if h = @header['content-type']
        h['charset'] or default
      else
        mime_version_charset || default
      end
    end

Defined in actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/interface.rb line 864 · View on GitHub · Improve this page · Find usages on GitHub

Defined in TMail::Mail

Type at least 2 characters to search.

↑↓ navigate · open · esc close