]> git.sommitrealweird.co.uk Git - curses-crossword.git/commitdiff
Actually encode to the terminals locale, if we can.
authorBrett Parker <iDunno@sommitrealweird.co.uk>
Thu, 9 Jul 2009 14:09:24 +0000 (15:09 +0100)
committerBrett Parker <iDunno@sommitrealweird.co.uk>
Thu, 9 Jul 2009 14:09:24 +0000 (15:09 +0100)
curses-crossword.py

index 19ee754ef125f87a3bcf9692701ce1fd6dbd1c2e..6d8791a64cfeda7e96a2fcfc145c74270431c898 100644 (file)
@@ -84,13 +84,13 @@ def parsecrossword(crossworddata):
                     parts = line.split()
                     question_number = int(parts[0])
                     clue = " ".join(parts[1:])
-                    crossword["across"][int(question_number)] = clue.encode('utf-8')
+                    crossword["across"][int(question_number)] = clue.encode(code)
             if indown:
                 if line != "":
                     parts = line.split()
                     question_number = int(parts[0])
                     clue = " ".join(parts[1:])
-                    crossword["down"][int(question_number)] = clue.encode('utf-8')
+                    crossword["down"][int(question_number)] = clue.encode(code)
     num_cols = len(crossword["grid"][0])
     num_rows = len(crossword["grid"])