Free Support Forum -

Special characters in Imap.ListMessages() not shown properly


The special characters in imap.ListFolders and imap.ListMessages are nor shown properly. We get some other symbols instead. Example is as given below:

Déplacement is displayed D&AOk-placement.
Reçus is displayed Re&AOk-us.
Messages envoyés is displayed Envoy&AOk-s

But the message text seems to be ok. Please let us know how to go about this.


Thank you for inquiry.

If a folder contains special characters like you mentioned above, then ImapFolderInfo.Name does not handle these special characters and display junk characters instead. I have verified this issue and logged this bug (ID: 29127). We will look into it and will inform you when it gets fixed.

But, if a message contains these special characters in subject, then ImapMessageInfo.Subject gets and displays the correct characters. I tried with latest release v6.6 and could not reproduce this with the email messages. Below is my code for your reference.

ImapFolderInfoCollection folderInfoColl = client.ListFolders();
foreach (ImapFolderInfo folderInfo in folderInfoColl)
Console.WriteLine("Folder: " + folderInfo.Name);

// get the folder with special characters - bug here
if (folderInfo.Name.Contains(“placement”) == true)

// list messages from this folder
ImapMessageInfoCollection msgInfoColl = client.ListMessages();
foreach (ImapMessageInfo msgInfo in msgInfoColl)
Console.WriteLine(msgInfo.Subject + " = Date: " + msgInfo.Date);
if (msgInfo.Subject.Contains("Déplacement ") == true)
MailMessage message = client.FetchMessage(msgInfo.SequenceNumber);
message.Save(“test.msg”, MailMessageSaveType.OutlookMessageFormat);
message.Save(“test-unicode.msg”, MailMessageSaveType.OutlookMessageFormatUnicode);

The issues you have found earlier (filed as 29127 ) have been fixed in this update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.