summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--l10ntools/scripts/tool/l10ntool.py3
-rw-r--r--l10ntools/scripts/tool/xhtex.py7
2 files changed, 5 insertions, 5 deletions
diff --git a/l10ntools/scripts/tool/l10ntool.py b/l10ntools/scripts/tool/l10ntool.py
index 70d88674f07b..f1630027ccdc 100644
--- a/l10ntools/scripts/tool/l10ntool.py
+++ b/l10ntools/scripts/tool/l10ntool.py
@@ -66,11 +66,10 @@ class AbstractL10nTool:
pass
################################################################################################
-
+
def format_outputfile(self, filename, language):
extension = filename[filename.rfind('.')+1:]
file = filename[:filename.rfind('.')]
-
# Python 2.3.x friendly
return self.get_outputfile_format_str().replace('[', '%(').replace(']',')s') % \
{ 'filename': filename, 'fileNoExt': file, 'language': language, 'extension': extension, 'path_prefix': self._options.path_prefix,
diff --git a/l10ntools/scripts/tool/xhtex.py b/l10ntools/scripts/tool/xhtex.py
index ae973aacc555..d916fc675944 100644
--- a/l10ntools/scripts/tool/xhtex.py
+++ b/l10ntools/scripts/tool/xhtex.py
@@ -56,13 +56,14 @@ class Xhtex(AbstractL10nTool):
if elem.childNodes[0].nodeType == elem.TEXT_NODE and elem.getAttribute("id").strip():
obj = self.prepare_sdf_line(inputfile=inputfilename, lang=lang, id=elem.getAttribute("id").strip())
if sdfdata[obj.get_id()]:
- elem.childNodes[0].data = str(sdfdata[obj.get_id()].text)
+ elem.childNodes[0].data = unicode(str(sdfdata[obj.get_id()].text),"utf8")
+
def merge_title(self, list, sdfdata, lang, inputfilename):
for elem in list:
obj = self.prepare_sdf_line(inputfile=inputfilename, lang=lang, id=elem.getAttribute("id").strip())
if elem.getAttribute("id").strip() and sdfdata[obj.get_id()]:
- elem.setAttribute("title", str(sdfdata[obj.get_id()].text))
+ elem.setAttribute("title", unicode(str(sdfdata[obj.get_id()].text),"utf8"))
# L10N tool
def __init__(self):
@@ -97,7 +98,7 @@ class Xhtex(AbstractL10nTool):
try:
f = open(outputfilename, "w+")
str = dom.toxml()
- f.write(str)
+ f.write(str.encode("utf-8"))
except IOError:
print "ERROR: Can not write file " + outputfilename
sys.exit(-1)