Fix problems with utf8-encoded nicknames in team chat (not tested)
authorunc0rr
Mon, 01 Mar 2010 17:54:12 +0000
changeset 2902 1566f05ca371
parent 2901 6d2636144e1f
child 2903 e28356fe532a
Fix problems with utf8-encoded nicknames in team chat (not tested)
gameServer/HWProtoInRoomState.hs
--- a/gameServer/HWProtoInRoomState.hs	Mon Mar 01 15:03:13 2010 +0000
+++ b/gameServer/HWProtoInRoomState.hs	Mon Mar 01 17:54:12 2010 +0000
@@ -204,7 +204,10 @@
         []
     where
         client = clients IntMap.! clID
-        engineMsg = toEngineMsg $ 'b' : (nick client ++ "(team): " ++ decodedMsg ++ "\x20\x20")
+        -- FIXME: why are those decoded* function used? 
+        -- it would be better to use ByteString instead of String
+        engineMsg = toEngineMsg $ 'b' : (decodedNick ++ "(team): " ++ decodedMsg ++ "\x20\x20")
         decodedMsg = UTF8.decodeString msg
+        decodedNick = UTF8.decodeString $ nick client
 
 handleCmd_inRoom clID _ _ _ = [ProtocolError "Incorrect command (state: in room)"]