Escaped Expressions

An escape expression (for example, \'hh, \\, or \{) is usable in all RTF control words.

Writer:

In general RTF should be written out with all characters above 0x80 in the escaped form, \'hh.

Character code Write out as
0x00 <= ch < 0x20 Escaped (\'hh)
0x20 <= ch < 0x80 Raw (non-escaped) character
0x80 <= ch <= 0xFF Escaped (\'hh)

For compatibility, there is an RTFParam option in the HKEY_CURRENT_USERF\Software\Microsoft\Word\7.0FE\ section of the registry database that determines whether raw 8-bit characters or escaped characters are used for the double-byte characters in \stylesheet, \fonttbl, \bkmkstart, and \bkmkend. This option is valid only when writing out the RTF; it does not affect RTF reading behavior.

[Microsoft Word]

RTFParam=7 (the default) uses an escaped expression when the character is above 0x80.

RTFParam=8 uses raw 8-bit characters for \stylesheet, \fonttbl, \bkmkstart, and \bkmkend (does not escape even if trailing-byte was an RTF special character such as \, {, or }).

Reader:

When the RTF reader encounters raw characters in the leading-byte range of the double-byte character, it regards the next character as the trailing byte of the double-byte character and combines the two characters into one double-byte character.

Leading byte Trailing byte Validity
Escaped Raw (0x20 <= ch <= 0x7f) Valid (standard format for double-byte character)
Escaped Escaped (other) Valid (standard format for double-byte character)
Raw Raw Valid (RTF-J format for double-byte character)
Raw Escaped Invalid