From af9e8893dfcaa27f454a895d4e1f44fdf06a3a8c Mon Sep 17 00:00:00 2001 From: oysteini Date: Sun, 16 May 2010 14:15:36 +0000 Subject: [PATCH] Eksplisitt konvertering av input til unicode. --- conf.py | 1 + text_based.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/conf.py b/conf.py index d55c10c..ee342ff 100644 --- a/conf.py +++ b/conf.py @@ -2,3 +2,4 @@ db_url = 'sqlite:///data' quit_allowed = True stop_allowed = False show_tracebacks = True +input_encoding = 'utf8' diff --git a/text_based.py b/text_based.py index 085ad2f..f9826b2 100755 --- a/text_based.py +++ b/text_based.py @@ -116,7 +116,8 @@ class Menu(): prompt = self.prompt while True: try: - result = raw_input(safe_str(prompt)) + result = unicode(raw_input(safe_str(prompt)), + conf.input_encoding) except EOFError: print 'quit' self.exit_menu()