An escape expression (for example, \'hh, \\, or \{) is usable in all RTF control words.
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) |
0x5C, 0x7B, 0x7D (special RTF characters \,{, or }) | Escaped (\'hh) |
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 |
Note Characters that are special RTF symbols (\,{, or }) should always be escaped, preferably using the \'hh syntax.