From da1d2c24881cac8beef9a8b4da3e74f1be0056b0 Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Thu, 12 Jul 2012 10:27:53 +0000 Subject: more unicode conversions issues --- (limited to 'TurtleArt/tawindow.py') diff --git a/TurtleArt/tawindow.py b/TurtleArt/tawindow.py index a2d93de..e2d0282 100644 --- a/TurtleArt/tawindow.py +++ b/TurtleArt/tawindow.py @@ -3419,7 +3419,10 @@ class TurtleArtWindow(): self.python_code self.set_userdefined(blk) if btype == 'string' and blk.spr is not None: - blk.spr.set_label(blk.values[0].replace('\n', RETURN)) + value = blk.values[0] + if type(value) == unicode: + value = value.encode('ascii', 'replace') + blk.spr.set_label(value.replace('\n', RETURN)) elif btype == 'start': # block size is saved in start block if value is not None: self.block_scale = value @@ -3859,6 +3862,8 @@ class TurtleArtWindow(): def _new_stack_block(self, name): ''' Add a stack block to the 'blocks' palette ''' + if type(name) == unicode: + name = name.encode('ascii', 'replace') if CURSOR in name: name = name.replace(CURSOR, '') if name == _('action'): -- cgit v0.9.1