新手问题 新手有关 eml 读取转换问题

bakadia · December 05, 2018 · Last by bakadia replied at December 06, 2018 · 976 hits
require 'mail'
mail_content = File.open('images/tmp.eml').read
mail = Mail.new(mail_content)
body = mail.body

使用了以上方式读取 eml 邮件,拿出来发现 body 编码格式是 7bit,解析困难。😭 然后用了几种转码方法都没有成功 并没有把内容转化成 UTF-8,就卡这里了。求问怎么正常转换成 UTF-8,或者直接把 eml 的文件转成 html 或者 txt

https://ruby-china.org/topics/33882 找到解决方法了,此贴终结

bakadia closed this topic. 06 Dec 09:11
You need to Sign in before reply, if you don't have an account, please Sign up first.