From 7755492d66d0207c4a07143ea3ec407458fb8e20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Blaisot?= Date: Mon, 10 Jul 2017 00:33:19 +0200 Subject: [PATCH] correctly escape special chars in wxl XML --- po2wxl.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/po2wxl.py b/po2wxl.py index 8a53322..59c9ed2 100755 --- a/po2wxl.py +++ b/po2wxl.py @@ -13,6 +13,7 @@ import sys import textwrap import os.path +from xml.sax.saxutils import escape import polib @@ -165,9 +166,9 @@ def usage(): f.write("\n") f.write(" \n \n") if entry.msgstr != "": - translation = entry.msgstr + translation = escape(entry.msgstr) else: - translation = entry.msgid + translation = escape(entry.msgid) translation = " ".join(translation.split("\n")).replace('\r', '').encode("utf-8") f.write(" " + translation + "\n")