Invisible character in an RTF file?

I have been writing an editor which allows you to type ancient Greek text as well as German (or English…); the application can open and save RTF files and that works quite well (in MacOS I use some declares to speed up RTF loading and saving, after adding some German special characters to be converted correctly).
It still bothered me that Xojo does not parse paragraph alignments, so that I had to write a workaround: While saving an RTF file, the application checks each paragraph and when its alignment is centered or right, it adds a tag at the first position of the paragraph; when opening a file it reads and removes the tags and aligns the paragraphs accodingly.

This workaround does pretty well in my editor, but it has one great drawback: When you open an RTF file with another editor than mine, a centered paragraph (e.g.) will read “\qc One paragraph.” instead of “One paragraph”. Then I thought about inserting an invisible character instead of "\qc " – like the invisible separator Unicode 2063 –, but the RTF parser does not seem to recognize it.
So my question is: Is there an invisible character I can use in Xojo which will be recognized while parsing RTF data?
Any suggestions will be gladly welcomed, because although my workaround does work (as I have mentioned) the application still feels “incomplete” to me as long as I have not found a way that is not recognizable as the mere workaround that it is at the moment…

Use \comment instead of placing your tag with regular text.


I’m afraid I lack some knowledge to work with RTF tags like the one you suggested (and I don’t quite understand the linked documentation). It starts with me being unable to insert “real” RTF tags in my files – otherwise I might have inserted the original RTF alignment tags --, because Xojo’s RTF parser seems to escape backslashes automatically (e.g. "\qc " in my code String appears as "\\qc " in the RTF data and I could not find a way to avoid that).

If I was able to do that, I would gladly write my own RTF parser because I work with text most of the time. But as a mere amateur programmer, I fear that is far out of my reach. So I thought working with invisible characters would be the easiest way…

Finally I managed to do some string replacements, so that RTF alignment in my editor works as well as in other RTF editors. The code is a bit complicated, though, so I have to revise it, but at least it does what it should do for now…