Email saved in Dictionary - CR LF not displayed correctly

I have ventured into trying to use dictionary again. Using some of the email example I can write email info into a dictionary 'ReceivedMessages ’ and can verify in debug that emailmessage are being placed in there. I have a method that has the following parameters id as integer, email as EmailMessage .

Then I place various aspects of this email message into a ListBox including this

MessagesList.Cell(MessagesList.LastIndex, 0) = str(id)

The last thing I do is this

// Add this to the Email Received Dictionary ReceivedMessages.Value(id) = Email

When you double click in the Listbox the message is displayed in another window. The window contains several ‘Labels’ for From, To, Date… and a ‘TextArea’ where I place the message. There are non printable ASCII Characters which I have determined are Line Feed-Carriage returns (10 & 13). I have tried several ways to have this displayed correctly but have not been able to figure that out. Any suggestions would be welcomed. Thanks

Instead of doing:

TextArea.Text = message

replace the Line Feed-Carriages with the line endings of the platform:

TextArea.Text = message.ReplaceAll(Chr(10) + Chr(13), EndOfLine)

Have you tried DefineEncoding?

I am seeing this CRLF with the diamond characters in some other TextAreas where I have not seen this before. I am using the default settings for ‘TextArea’ and my understanding after reading the manual is that this should be displayed correctly.

@Elli Ott - already used that with same result

@Tim Hare - set that to UTF8 with same result

Try with

TextArea.Text = ReplaceLineEndings(message, EndOfLine)

I remember having this problem, too, and the above code solved the problem.

@Beatrix Willius - that worked - thanks

Thanks to everyone who responded