Fix the crash from #912099 ITS Tool 2.0.4 crashes when building some documentation, as reported in #912099. This comes from translations with invalid XML markup, which ITS Tool fails to merge (which is not abnormal), and to report these issues, needlessly encodes the original msgstr from unicode to bytes, causing it to be recoded using the default ascii codec, which fails when the msgstr contains anything out of ascii. . This patch removes the useless decoding, avoiding the failing subsequent recoding. It also explicitly encodes the output strings to be able to print them in all cases, even when the output encoding cannot be detected.
Fix the crash from #918953 ITS Tool 2.0.4 crashes when output is redictected to a pipe, as reported in #918953. This comes from Python not knowing the preferred encoding for stdout, and using ASCII by default, therefore failing to encode anything outside of it. . This patch makes ITS Tool write to an UTF-8 encoding wrapper around stdout.