I have attached a zip file with
- the original rtf body (body.rtf)
- the converted html body (body.html)
- the resulting email message snapshot.msg
The conversion code snippet is this:
public static String convertRTFBody2Html(String body) {
MapiMessage mapi = new MapiMessage();
mapi.setBodyRtf(body);
MailMessageInterpretor mi = MailMessageInterpretorFactory.getInstance().getIntepretor(MapiMessage.class.getName());
MailMessage mailMessage = mi.interpret(mapi);
return mailMessage.getHtmlBody();
}
Original RTF line:
{\*\htmltag64 <p class="MsoNormal">}\htmlrtf {\htmlrtf0 1.duplicate attachments
Converted RTF line:
{\*\htmltag64 <p class="MsoNormal">}\htmlrtf {\htmlrtf01.duplicate attachments
It appears that when the line of text starts with a number and there is no space between the start of the line and the end of the "\htmlrtf0" tag, the number will be mistaken as part of the tag. So the rendering engine seems to be looking for "\htmlrtf0" but is finding "\htmlrtf01" and is not correctly rendering the text properly.