I performed some tests yesterday, and I found that when you allow Geany to guess the encoding, then it switches to UTF-16 (or something like that), showing lots of chinese-like characters. When UTF-8 or no encoding is forced on load, then its behavior is the one I reported.
I don't know whether it is helpful, but along these years I found some real scenarios where a NUL character can appear in a text file:
* A case I have found in the past were protein sequences in FASTA format from a non redundant database or program. Some of these were using (or allowed) the NUL character as a separator of concatenated descriptions in the header of a FASTA entry representing a cluster of protein sequences. * Another case where NUL character appears in an unintended way is a linux system hang, in the logs of a service. The service is sending its logs through system logging facility, and the system had a hard hang due any reason. The last block assigned to those files just after the hang can be "half baked", because the block was assigned but not written. Then, when the system is rebooted and restarted the service, the log will be appended, and the NUL characters are there.