Do you remember what version that issue happened on? Were you using unicode characters or a non-UTF8 encoding? That sounds like an annoying issue and it would be great to fix it.
I don't remember the details, unfortunately. I think there was a pattern to it, like they were control characters or something. But it silently inserted them, and they were not visible within the editor, but they were visible in nano/less/etc.
Again, this was awhile ago, but I don't think they were single characters, it was a sequence of characters.