I see, you're working with log files in text format. This script only works with HTML formatted log files (encrypted or decrypted). Encrypting and decrypting will work just fine but merging works with the actual log contents and needs those contents to be HTML.
The problem is caused by the script seeing a PLE file and assuming that the content is HTML. It doesn't check whether the decrypted content is valid HTML. I understand that this should actually be checked by the script, I never actually tested it with text log files. I don't see why anyone would still want to use text logs when the HTML logs are so much better though.
(Those "invisible characters" are actually null characters as the script writes as Unicode. However since there's no byte flag or content type specified, Notepad and WordPad will open it as ANSI and show those null characters as spaces.)