【问题标题】:Mime utility decode word and textMime 实用程序解码单词和文本
【发布时间】:2023-03-19 19:59:02
【问题描述】:

Mime 实用程序解码

MimeUtility.decodeWord()MimeUtility.decodeText() 有什么区别? 请用一个小例子解释一下

【问题讨论】:

  • 没有javadoc?

标签: java mime decoding


【解决方案1】:

取自http://docs.oracle.com/javaee/6/api/javax/mail/internet/MimeUtility.html

解码文本

decodeText(java.lang.String etext) 解码“非结构化”标头,即根据 RFC 822 定义为“*text”的标头。

解码字

decodeWord(java.lang.String eword) 使用 RFC 2047 和 RFC 2231 中的规则解析字符串以解析“编码字”。

【讨论】:

  • 主题:=?UTF-8?B?cHJhc2FubmE=?= decodeText() workingfine decodeWord() throws Exception =?utf-8?q?this is some text?= =?UTF-8 ?B?cHJhc2FubmE=?= decodeWord() 工作正常,但 decodeText() 显示未解码的主题
猜你喜欢
  • 2011-06-26
  • 2011-04-22
  • 2012-12-10
  • 2023-04-06
  • 2011-10-03
  • 2011-07-30
  • 2013-12-11
  • 2014-07-03
  • 2021-12-30
相关资源
最近更新 更多