HTMLviewer '=' problem

Hi,
Have just use a HTMLviewer to show HTML from an email by using this code

Var f As FolderItem
HTMLViewer1.LoadPage(email.bodyhtml, f)

Have missed some of code which just retrieves the email

The problem is that it shows the text correctly but it shows the ‘=’ sign in the code were I think it should be a line return, is there anyway I can stop this.

Sorry if I have missed something obvious.

Ian

That’s quoted printable encoding (Quoted-printable - Wikipedia). The text can be decoded with https://documentation.xojo.com/api/text/encoding_text/decodequotedprintable.html .

The EmailMessage class doc doesn’t mention whether the HTML body of the email that you receive has been properly decoded or not by the time it’s available to be used. Sounds like it just pays attention to the Content-Type: header which should be “text/html” for an HTML body, but not the Content-Transfer-Encoding: header which may specify plain text, or, as in the OP’s case, quoted-printable. Or it might be Base64 encoded, too.

Thanks for the info but not sure how to apply that to a HTMLviewer box.

This might help…

If I put the HTML into a Textfield then this is what appears.

<!doctype html>

Thank you for your order! ..... ...... only showing part.

And this is what appears in HTMLviewer

Thank= you for your order!
am not sure how to access the text in a HTMLviewer box as would filter it.

Any idea’s…

Sorry forgot to say am running windows 10 Pro…

Before doing the LoadPage you need to decode the bodyhtml as Beatrix suggests. It’s the output of that which you send to the HTMLViewer with LoadPage.

Thank you for your help did as Beatrix suggested.

s = decodeQuotedPrintable(email.bodyhtml)

HTMLViewer1.LoadPage(s, f)

It not works fine.

Now I just need to get the text from the HTMLviewer.

Thank You again.

Ian