Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@gmail.com>2012-08-27 14:09:23 (GMT)
committer Simon Schampijer <simon@laptop.org>2012-09-26 11:29:07 (GMT)
commit5fdad9481ba7079a6a718159ebe7eb8e5367c46e (patch)
tree7976beb06afd875db73e952c806b8545b1f46806
parent3a30d3f84ea65d4576ada44b70c434bef0a7f667 (diff)
Set default python encoding to utf-8
As spoted by Daniel Narvaez in [1], pygi does not set the default encoding anymore as the old GTK+ did. This change does break activities ported to GTK+3. The change in GTK+ has been discussed upstream here [2]. A better solution will be implemented when we port to Python 3, when we will be able to use real unicode strings. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org> Acked-by: Simon Schampijer <simon@laptop.org> [1] http://lists.sugarlabs.org/archive/sugar-devel/2012-August/038993.html [2] https://bugzilla.gnome.org/show_bug.cgi?id=681915
-rw-r--r--bin/sugar-activity6
1 files changed, 6 insertions, 0 deletions
diff --git a/bin/sugar-activity b/bin/sugar-activity
index 5aef1ae..abaa091 100644
--- a/bin/sugar-activity
+++ b/bin/sugar-activity
@@ -18,6 +18,12 @@
import os
import sys
+
+# Change the default encoding to avoid UnicodeDecodeError
+# http://lists.sugarlabs.org/archive/sugar-devel/2012-August/038928.html
+reload(sys)
+sys.setdefaultencoding('utf-8')
+
import gettext
from optparse import OptionParser