Skip to content

Mail.new() crashes with error: invalid byte sequence in UTF-8 #1634

@Chris78

Description

@Chris78

The crash happens on line 2015 of mail Gem, version 2.8.1:

    def set_envelope_header
      raw_string = raw_source.to_s
      if match_data = raw_string.match(/\AFrom\s+([^:\s]#{Constants::TEXT}*)#{Constants::LAX_CRLF}/m)

To me it looks like the encoding

Content-Type: text/plain; charset=WINDOWS-1252
Content-Transfer-Encoding: 7bit

might be responsible along with a special apostrophe character in:
haven’t

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