2.2.3.1 Recognizing RTF Containing Encapsulation

Before the de-encapsulating RTF reader tries to recognize the encapsulation, the reader SHOULD<13> ensure that the document has a valid RTF document heading according to [MSFT-RTF] (that is, it starts with the character sequence "{\rtf1").

The de-encapsulating RTF reader SHOULD<14> inspect no more than the first 10 RTF tokens (that is, begin group marks and control words) in the input RTF document, in sequence, starting from the beginning of the RTF document. If one of the control words is the FROMHTML control word, the de-encapsulating RTF reader SHOULD conclude that the RTF document contains an encapsulated HTML document and stop further inspection. If one of the control words is the FROMTEXT control word, the de-encapsulating RTF reader SHOULD conclude that the RTF document was produced from a plain text document and stop further inspection.

During the inspection, the de-encapsulating RTF reader SHOULD conclude that there is no encapsulated content and that this is a normal (pure) RTF document if any of the following conditions are true:

  • There are any RTF tokens besides the begin group mark "{" or a control word within the first 10 tokens.

  • There is no FROMHTML or FROMTEXT control word within the first 10 tokens.

Show: