Skip to content

Invalid byte sequence in UTF-8 when calling Mail::Message.encoded #861

@whather

Description

@whather

I sporadically get this error when calling "encoded" on a message. This is the backtrace:

invalid byte sequence in UTF-8
ruby/2.1.0/gems/mail-2.6.3/lib/mail/fields/unstructured_field.rb:126:in `split'
ruby/2.1.0/gems/mail-2.6.3/lib/mail/fields/unstructured_field.rb:126:in `fold',
ruby/2.1.0/gems/mail-2.6.3/lib/mail/fields/unstructured_field.rb:103:in `wrapped_value',
ruby/2.1.0/gems/mail-2.6.3/lib/mail/fields/unstructured_field.rb:69:in `do_encode',
ruby/2.1.0/gems/mail-2.6.3/lib/mail/fields/unstructured_field.rb:51:in `encoded',
ruby/2.1.0/gems/mail-2.6.3/lib/mail/field.rb:189:in `method_missing',
ruby/2.1.0/gems/mail-2.6.3/lib/mail/header.rb:210:in `block in encoded',
ruby/2.1.0/gems/mail-2.6.3/lib/mail/header.rb:209:in `each',
ruby/2.1.0/gems/mail-2.6.3/lib/mail/header.rb:209:in `encoded',
ruby/2.1.0/gems/mail-2.6.3/lib/mail/message.rb:1811:in `encoded'

Has anyone hit this and if so do you know of a fix/workaround? All of the other UTF-8 fixes I've seen, I believe I already have.

Cheers,
Wes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions