我正在尝试解码我认为出现在 MBox 电子邮件存档中的一些引用可打印编码文本。我将举一个我遇到问题的文本的例子。
在 MBox 中,出现以下文本:
“Theresa Castel=E3o-Lawless 的划界”
正确解码,我认为这应该显示为:
“Theresa Castelão-Lawless 的划界”
我的陈述是基于它应该看起来像什么
1) 电子邮件的网络存档,其中的文本正确呈现为“Theresa Castelão-Lawless 的划界”
和 2) 这个页面,它显示“=E3”对应于引用打印https://www.ic.unicamp.br/~stolfi/EXPORT/www/ISO-8859-1-Encoding 的“ã”。 html
我已经尝试了下面的代码,但它给出了错误的输出。
string = "Demarcation by Theresa Castel=E3o-Lawless"
decoded_string = Mail::Encodings::QuotedPrintable.decode(string)
puts decoded_string + "\n"
上面代码的结果是“Theresa Castel?o-Lawless 的划界”,但如上所述,我想要“Theresa Castel?o-Lawless 的划界”