Rails 3 - (incompatible character encodings: UTF-8 and ASCII-8BIT):

前端 未结 3 1870
滥情空心
滥情空心 2021-01-06 04:16

incompatible character encodings: UTF-8 and ASCII-8BIT

I\'m finding lots of old information yet scant advice about this error message but wondered w

3条回答
  •  被撕碎了的回忆
    2021-01-06 04:33

    For the time being, this can be caused by an issue in Mail 2.5.4, which 'pollutes' the encoding of the mail object.

    @email = Email.find(1)
    @email.body.encoding # This is a fresh instance from db, still okay
    Mail.new(@email.body)
    @email.body.encoding # value has been changed
    

提交回复
热议问题