summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaun McCance <shaunm@gnome.org>2012-04-02 09:51:30 -0400
committerShaun McCance <shaunm@gnome.org>2012-04-02 09:51:30 -0400
commit3ff47350b0386c971e4fb1955f87fefc2c5aafd1 (patch)
tree9371133f6080db9c72da7494a336baf45d1d7618
parent1e0fa47194bbfcbd30e402a4897a0856a6045b73 (diff)
downloaditstool-3ff47350b0386c971e4fb1955f87fefc2c5aafd1.tar.gz
Handle UTF-8 in attribute values
-rwxr-xr-xitstool.in2
1 files changed, 2 insertions, 0 deletions
diff --git a/itstool.in b/itstool.in
index b4d6a89..d1ff0fe 100755
--- a/itstool.in
+++ b/itstool.in
@@ -169,6 +169,8 @@ class Message (object):
if prop.ns() is not None:
name = prop.ns().name + ':' + name
atval = prop.content
+ if not isinstance(atval, unicode):
+ atval = unicode(atval, 'utf-8')
atval = atval.replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;').replace('"', '&quot;')
self._message += " %s=\"%s\"" % (name, atval)
if node.children is not None: