Fix encoding of plaintext backups

Open Bastien Le Querrec requested to merge github/fork/whiver/patch/xml_encoding into unstable

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.

Merge request reports