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)
(key, value) = line.strip().split(' ', 1)\r
\r
# Server (S) and Nick (n) fields can have international characters.\r
- # We first convert to UTF-8, then to ASCII. Characters will be lost\r
- # in this conversion for the sake of presenting what otherwise \r
- # would have to use CSS sprites.\r
+ # We convert to UTF-8.\r
if key in 'S' 'n':\r
- value = qfont_decode(unicode(value, 'utf-8'))\r
+ value = unicode(value, 'utf-8')\r
\r
if key in 'V' 'T' 'G' 'M' 'S' 'C' 'R' 'W':\r
game_meta[key] = value\r