Hi there
I have a little problem with the getSubject() method in a Message object. It returns me some '???' instead of a normal '-' (dash). I think it is an encoding problem but I'm not sure. I tried the same message on another Mail server (first I tried on Zimbra, then on Exchange) and I get then some strange squars instead of the dash. Anyway, if I look for the IMAP messages which JavaMail sends when I access the getSubject-method I see that there is my dash. In other words, the response of the mail server is correct. Is it possible that JavaMail messes up something internally?
Here is my code I'm using:
IMAPFolder fz = (IMAPFolder) zStore.getDefaultFolder().getFolder("inbox/save");
Message[] msgs = f.getMessages();
FetchProfile fp = new FetchProfile();
fp.add(UIDFolder.FetchProfileItem.FLAGS);
fp.add(IMAPFolder.FetchProfileItem.SIZE);
fp.add(UIDFolder.FetchProfileItem.UID);
f.fetch(msgs, fp);
System.out.println("Subject: " + msgs[0].getSubject());
This is the IMAP response which shows me JavaMail in the debug mode:
A7 FETCH 1 (ENVELOPE INTERNALDATE RFC822.SIZE)
* 1 FETCH (ENVELOPE ("Sat, 31 Jan 2009 23:07:38 +0800" {55}
Una potenzialita piccola – noi lo possiamo risolvere (("Roxie Ochocki" NIL "zwmbelle" "croston-engineering.co.uk")) (("Roxie Ochocki" NIL "zwmbelle" "croston-engineering.co.uk")) (("Roxie Ochocki" NIL "zwmbelle" "croston-engineering.co.uk")) (("..." NIL "..." "...")) NIL NIL NIL "<001501c983f8$b5d65360$058a9f6c@MYCHAT1F75848B>") INTERNALDATE "31-Jan-2005 18:27:51 +0100" RFC822.SIZE 3259)
A7 OK FETCH completed.
As you can see the subject contains a dash (it is the thing that begins with 'una potenzialita piccola...').
The output of the getSubject method is something like:
Subject: Una potenzialita piccola รข€“ noi lo possiamo risolvere
Any suggestions how to solve this problem?