Fixes for #467

Decode string in Content-disposition header parameter such as "filename" properly.

perfect :)

On Thu, Nov 20, 2014 at 9:23 PM, okkez <notifications@github.com> wrote:

> In lib/mail/fields/common/parameter_hash.rb:
>
> > @@ -29,7 +29,7 @@ def [](key_name)
> >          super(exact || key_name)
> >        else # Dealing with a multiple value pair or a single encoded value pair
> >          string = pairs.sort { |a,b| a.first.to_s <=> b.first.to_s }.map { |v| v.last }.join('')
> > -        if mt = string.match(/([\w\-]+)'(\w\w)'(.*)/)
> > +        if mt = string.match(/([\w\-]+)'(\w*)'(.*)/)
>
> https://tools.ietf.org/html/rfc2231#section-7
>
> extended-initial-value := [charset] "'" [language] "'"
> extended-other-values
>
> language tag can be empty.
> Thuderbird generates such header field as following:
>
> Content-Disposition: attachment;
> filename*0*=iso-2022-jp''%1B%24%42%25%22%25%24%25%46%25%60%1B%28%42%2E%63;
> filename*1*=%73%76
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/mikel/mail/pull/819/files#r20699021>.
>