From cd7177897562379fe799ac7238fb0e690bf4ccc4 Mon Sep 17 00:00:00 2001 From: Mika Bostrom Date: Tue, 19 Jan 2010 19:25:36 +0200 Subject: [PATCH] Fix name display in HUD popup The names are stored in UTF-8, so simply converting the name from UTF-8 to Configuration.LOCALE_ENCODING before putting the string in tooltip is enough. Neat. --- pyfpdb/Stats.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pyfpdb/Stats.py b/pyfpdb/Stats.py index 86caaea5..18913eed 100755 --- a/pyfpdb/Stats.py +++ b/pyfpdb/Stats.py @@ -62,9 +62,13 @@ import Database re_Places = re.compile("_[0-9]$") re_Percent = re.compile("%$") +# String manipulation +import codecs +encoder = codecs.lookup(Configuration.LOCALE_ENCODING) def do_tip(widget, tip): - widget.set_tooltip_text(tip) + (_tip, _len) = encoder.encode(tip) + widget.set_tooltip_text(_tip) def do_stat(stat_dict, player = 24, stat = 'vpip'): match = re_Places.search(stat)