From 4aa4b0689f57057cd79ba77f83f5ba7d338bac3d Mon Sep 17 00:00:00 2001
From: Ant Zucaro <azucaro@gmail.com>
Date: Mon, 21 Nov 2011 15:02:02 -0500
Subject: [PATCH] Dave does have a point.

---
 xonstat/util.py             | 4 ++++
 xonstat/views/submission.py | 6 ++----
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/xonstat/util.py b/xonstat/util.py
index 9caf856..15565db 100755
--- a/xonstat/util.py
+++ b/xonstat/util.py
@@ -68,6 +68,10 @@ def html_colors(str=''):
         str = ''
 
     orig = str
+
+    # "downsample" the given UTF-8 characters to ASCII
+    str = qfont_decode(str)
+
     str = re.sub(r'\^x(\w)(\w)(\w)', 
             "<span style='color:#\g<1>\g<1>\g<2>\g<2>\g<3>\g<3>'>", str)
     str = re.sub(r'\^1', "<span style='color:#FF9900'>", str)
diff --git a/xonstat/views/submission.py b/xonstat/views/submission.py
index 36e0941..1c4f2fa 100755
--- a/xonstat/views/submission.py
+++ b/xonstat/views/submission.py
@@ -420,11 +420,9 @@ def parse_body(request):
             (key, value) = line.strip().split(' ', 1)
 
             # Server (S) and Nick (n) fields can have international characters.
-            # We first convert to UTF-8, then to ASCII. Characters will be lost
-            # in this conversion for the sake of presenting what otherwise 
-            # would have to use CSS sprites.
+            # We convert to UTF-8.
             if key in 'S' 'n':
-                value = qfont_decode(unicode(value, 'utf-8'))
+                value = unicode(value, 'utf-8')
     
             if key in 'V' 'T' 'G' 'M' 'S' 'C' 'R' 'W':
                 game_meta[key] = value
-- 
2.39.5