[rkward-cvs] [rkward] /: Work around some encoding problems while extracting messages.

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Fri Jan 30 17:12:41 UTC 2015

Git commit ab00912206543c498a78b908c935a9d2783c3183 by Thomas Friedrichsmeier.
Committed on 30/01/2015 at 17:11.
Pushed by tfry into branch 'master'.

Work around some encoding problems while extracting messages.
Give distributions.pluginmap a po_id. Do _not_ extract it, yet, as there are some problems remaining.

M  +1    -1    rkward/plugins/distributions.pluginmap
M  +5    -1    scripts/update_plugin_messages.py


diff --git a/rkward/plugins/distributions.pluginmap b/rkward/plugins/distributions.pluginmap
index 4a19ead..f0b1fc7 100644
--- a/rkward/plugins/distributions.pluginmap
+++ b/rkward/plugins/distributions.pluginmap
@@ -1,6 +1,6 @@
 <!DOCTYPE rkpluginmap>
-<document base_prefix="distributions/" namespace="rkward" id="distributions">
+<document base_prefix="distributions/" namespace="rkward" id="distributions" po_id="distributions">
 	<include file="pluginmap_meta.inc"/>
diff --git a/scripts/update_plugin_messages.py b/scripts/update_plugin_messages.py
index 01d8abb..8440893 100755
--- a/scripts/update_plugin_messages.py
+++ b/scripts/update_plugin_messages.py
@@ -100,7 +100,7 @@ def parseFile (filename):
   f.close ()
-    return minidom.parseString (content)
+    return minidom.parseString (content.encode ('utf-8'))
     sys.stderr.write ("ERROR: Failed to parse file " + filename + "\n")
@@ -145,6 +145,10 @@ def writeouti18n (call):
   outfile.write (call + "\n")
 def quote (text):
+  try:
+     text = text.decode ('utf-8', 'ignore')
+  except:
+     print ("Python has trouble decoding this text: " + text)
   text = HTMLParser.HTMLParser ().unescape (text)	# unescape character entities, Qt does so while parsing the xml
   return "\"" + text.replace ("\\", "\\\\").replace ("\"", "\\\"") + "\""

Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
rkward-cvs mailing list
rkward-cvs at lists.sourceforge.net

More information about the rkward-tracker mailing list