diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2010-10-05 19:01:32 +0200 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2010-10-05 19:01:32 +0200 |
commit | 519a2b9f2b61c6ccc09b3455cd2869340559f079 (patch) | |
tree | 4e8620eba8d3bb0047bd3c025d589d3c472cfa54 | |
parent | 36524b9df562caa67e885575a25acc3bcf19e081 (diff) |
ooo330l10n4: utf8 encoding issue
-rw-r--r-- | l10ntools/scripts/tool/l10ntool.py | 3 | ||||
-rw-r--r-- | l10ntools/scripts/tool/xhtex.py | 7 |
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) |