There's no fully reliable way to put an invisible mark in a text file. A text file has no room for anything that isn't plain text, after all. Comments (text that doesn't belong in the main text) are a form of markup.
Null bytes are a bad idea not only because they may be rendered as
� or other ways, but also because many text processing tools choke on them. Null bytes are an end-of-string marker in the C programming language and many programs treat it as the end of a text chunk (e.g. of a line, but not necessarily) because they're written in C or use libraries written in C.
If your text is encoded in Unicode, you can use one of its several zero-width characters:
- U+200B ZERO WIDTH SPACE (a zero-width breaking space)
- U+200C ZERO WIDTH NON-JOINER (a zero-width word constituent that prevents ligatures)
- U+200D ZERO WIDTH JOINER (a zero-width word constituent that forces ligatures)
- U+2060 WORD JOINER (a zero-width non-breaking space)
The spaces are not word constituents, the others are. Although none of these characters are visibly rendered (assuming a viewer with reasonable Unicode support), this has an impact when selecting text, moving around, searching, etc. The breaking space can be rendered as a line break.