diff options
Diffstat (limited to 'TurtleArt/tautils.py')
-rw-r--r-- | TurtleArt/tautils.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/TurtleArt/tautils.py b/TurtleArt/tautils.py index 650f2ec..634ee01 100644 --- a/TurtleArt/tautils.py +++ b/TurtleArt/tautils.py @@ -184,7 +184,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: @@ -369,7 +369,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)) @@ -413,7 +413,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)) |