我在使用charset = t.101-g2解析某种类型的邮件编码时遇到问题
我在Grails中使用Java直接使用lib,从IMAP获取未读电子邮件,并为每条消息尝试获取内容 Object msgContent = msg.getContent()
该行正在抛出错误。
例外
java.io.UnsupportedEncodingException: t.101-g2 [See nested exception: java.io.UnsupportedEncodingException: t.101-g2
at java.io.InputStreamReader.<init>(InputStreamReader.java:100)
at com.sun.mail.handlers.text_plain.getContent(text_plain.java:107)
at javax.activation.DataSourceDataContentHandler.getContent(DataHandler.java:790)
at javax.activation.DataHandler.getContent(DataHandler.java:537)
at javax.mail.internet.MimeMessage.getContent(MimeMessage.java:1453)
邮件就像:
Content-Transfer-Encoding: 8bit
From: "Some Email" <some_email@some.com>
Content-type: text/plain; charset=t.101-g2
Subject: SomeSubject
Date: Fri, 12 Jun 2015 06:55:36 -0500
X-Source: /usr/local/cpanel/bin/autorespond
X-Source-Args: /usr/local/cpanel/bin/autorespond some_email@some.com /home/oriental/.autorespond
X-Source-Dir: /home/oriental
Some Text
答案 0 :(得分:1)