I'm looking for a cross-platform way of storing small amounts of metadata for UTF-8 text files. Things like current selection and cursor position. I know about filesystem-specific solutions like using extended attributes on Linux and have read up on various solutions for MacOS here, but I'm wondering whether there is some "most accepted, lowest common denominator" way across platforms.
Is it possible to end a UTF-8 file with a special marker that many plain text editors recognize? If not, and I have to store the metadata in another file, is there a best practice for the file format and how to name this file? Or, is there a file format using UTF-8 like .rtf that allows me to store metadata and is handled just fine by most platforms?
I'm trying to decide on the best way for an application running on Windows, Linux, and MacOS, and what I've found so far is very platform and filesystem specific.