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.
精彩评论