Fix encoding of plaintext backups
Created by: whiver
Fixes #659 : Rewrite special characters escaping in plaintext backups to avoid having some characters illegally escaped (such as surrogates characters). This PR uses Apache Commons's XML escaping method instead, which correctly handles character encoding, so the part using regex to match characters that needed to be encoded has been removed.
Also force UTF-8 encoding of output file to match the charset specified in it.