Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/TurtleArt/tautils.py
diff options
context:
space:
mode:
authorWalter Bender <walter@sugarlabs.org>2013-10-07 12:21:28 (GMT)
committer Walter Bender <walter@sugarlabs.org>2013-10-07 12:21:28 (GMT)
commit27ba932b53f2ea3f11d2d43c3eb77b708da4bdb7 (patch)
treefac6bcb72942347ce36f77ed5b1df293f03bed62 /TurtleArt/tautils.py
parent869685b9747d48a128fd25ebf93b78324d3eb58a (diff)
resync with v191
Diffstat (limited to 'TurtleArt/tautils.py')
-rw-r--r--TurtleArt/tautils.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/TurtleArt/tautils.py b/TurtleArt/tautils.py
index 07b72d9..b0aa368 100644
--- a/TurtleArt/tautils.py
+++ b/TurtleArt/tautils.py
@@ -186,7 +186,7 @@ def find_hat(data):
def _to_str(text):
''' Convert whatever to a str type '''
if isinstance(text, unicode):
- return text.encode('ascii', 'replace')
+ return text.encode('utf-8')
elif isinstance(text, str):
return text
else:
@@ -371,7 +371,7 @@ def data_from_string(text):
if isinstance(text, str):
return json_load(text.replace(']],\n', ']], '))
elif isinstance(text, unicode):
- text = text.encode('ascii', 'replace')
+ text = text.encode('utf-8')
return json_load(text.replace(']],\n', ']], '))
else:
print 'type error (%s) in data_from_string' % (type(text))
@@ -415,7 +415,7 @@ def save_picture(canvas, file_name):
cr.set_source_surface(x_surface)
cr.paint()
if isinstance(file_name, unicode):
- img_surface.write_to_png(str(file_name.encode('ascii', 'replace')))
+ img_surface.write_to_png(str(file_name.encode('utf-8')))
else:
img_surface.write_to_png(str(file_name))