开发者

JavaMail Recipients - encoding problem?

I have small problem with JavaMail. Sometimes method getRecipients from class Message returns weird thing, a part of mycode:

Message开发者_StackOverflow社区 m = parent.getAgent().getMessages()[size-row-1];
m.getRecipients(Message.RecipientType.TO)[0].toString();

for some messages I have proper value like:

Pracuj.pl <pracuj@emails.pracuj.pl>

while some are like:

=?ISO-8859-2?Q?Jakas_Nazwa?= <jakas_nazwa@costam.pl>

Any idea what might be the problem? Maybe coding of Polish chars (ISO 8859-2)?


It's definitely an encoding issue. Try calling MimeUtility#decodeText on the returned recipient string.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜