Ok, the error itself is fairly obvious - the supposedly plain text strings contained some non-ASCII characters. Finding those characters was the issue. I tried grep ("[^:print:]" and a few others) and nedit but couldn't see the issue. Turns out just using
lesssolved my problems. The non-ASCII characters are highlighted for all to see (so they're easy to remove using a text editor at that point).
Oh, and if you're interested I was using stringdot from the 'kernlab' package to compare the strings.