I did a somewhat nasty trick to get hg log output formatted in an easy
to parse manner:
hg log --template
"<modification><node>{node|short}</node><author>{author|user}</author><date>{date|rfc822date}</date><desc>{desc|escape}</desc><rev>{rev}</rev><email>{author|email|obfuscate}</email><files>{files}</files></modification>"
This gets hg to output "pseudo-xml" which I then parsed with the
Exortech.NetReflector parser.
Try finding the invalid character that caused this and then we can see
what can be done.