Class | TMail::Attachment
In: | lib/tmail/attachments.rb lib/tmail/quoting.rb
Parent: | StringIO

### Methods

original_filename quoted?

### Included Modules

TextUtils

### External Aliases

original_filename | -> | quoted_filename

### Attributes

content_type | [RW] |
original_filename | [RW] |

### Public Instance methods

original_filename(to_charset = 'utf-8')

Only unquote if quoted

[Source]

    # File lib/tmail/quoting.rb, line 68
        def original_filename(to_charset = 'utf-8')
          if quoted?(quoted_filename)
            Unquoter.unquote_and_convert_to(quoted_filename, to_charset).chomp
          else
            quoted_filename
          end
        end

quoted?(string)

[Source]

    # File lib/tmail/quoting.rb, line 63
        def quoted?(string)
          !!((string =~ /.+'\w\w'.+/) || (string =~ /=\?.+\?.\?.+\?=/))
        end

[Validate]