From 61eb7c91300eed64ef3bcef2ac457cf218c17e80 Mon Sep 17 00:00:00 2001 From: Michael Ziegler Date: Wed, 15 Jul 2009 15:10:22 +0200 Subject: [PATCH] fixed a few encoding issues --- cli.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cli.py b/cli.py index ed1db32..211430d 100755 --- a/cli.py +++ b/cli.py @@ -39,12 +39,16 @@ os.environ['DJANGO_SETTINGS_MODULE'] = 'pyweb.settings' # Uncomment this line to point the egg cache to /tmp. #os.environ['PYTHON_EGG_CACHE'] = '/tmp/pyeggs' +import locale import curses from django.db.models.fields.related import ForeignKey from mumble.models import * +locale.setlocale(locale.LC_ALL, '') + + def getNum( prompt, **kwargs ): id = None; while type(id) != int: @@ -247,11 +251,13 @@ class WndChannels( BaseWindow ): tabName = 'Channels'; def printItem( self, item, level ): + str = ""; if item.is_server or item.is_channel: - self.win.addstr( self.curr_y, 2*level+1, "%s (Channel)" % unicode(item.name) ) + str = "%s (Channel)" % item.name; else: - self.win.addstr( self.curr_y, 2*level+1, "%s (Player)" % unicode(item.name) ) + str = "%s (Player)" % item.name + self.win.addstr( self.curr_y, 4*level+1, str.encode(locale.getpreferredencoding()) ) self.curr_y += 1; def draw( self ):