KSP-KOS/KOS — pull request #418 by Dunbaratu (2014-11-22 16:40:00+00:00)
Title: Fixes #393.

The real problem turned out to just one one missing line of code. But while I was at it, I also refactored the ampersand-encoding of dangerous characters in the persistence file, which was a fix I made on the way to trying to discover the problem, because I was barking up the wrong tree at first. But I'm reluctant to remove the change because I think the new way is superior to the old, even if it wasn't the cause of the problem.

The new ampersand-encoding system made the following change:

Old way: (a blacklist): Assume all characters are safe to write out raw except for those which are explicitly mentioned. Create an ad-hoc encoding hardcoded for each exception case.

New way: (a whitelist): Assume all characters are UNsafe to write out raw except for those which are explicitly mentioned. For anything not white-listed, create a generic encoding system that works for any arbitrary character. (It's always the HTML escape "&#____;" where the ____ is the decimal integer ordinal of the character in whatever character encoding (unicode in this case) is being used.)