Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2004:
[Freeciv-Dev] (PR#10014) Can not use non-ASCII characters in chat messag
Home

[Freeciv-Dev] (PR#10014) Can not use non-ASCII characters in chat messag

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#10014) Can not use non-ASCII characters in chat messages
From: "Mateusz Stefek" <mstefek@xxxxxxxxx>
Date: Fri, 10 Sep 2004 01:12:51 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=10014 >

This is because the code in handle_chat_msg_req treats UTF-8 _bytes_ as
nonprintable ascii.
Patch attached.
--
mateusz
? civgame-3700.sav.gz
? civgame-3950.sav.gz
Index: handchat.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/handchat.c,v
retrieving revision 1.31
diff -u -r1.31 handchat.c
--- handchat.c  29 Jul 2004 00:09:27 -0000      1.31
+++ handchat.c  10 Sep 2004 08:11:41 -0000
@@ -155,11 +155,12 @@
 
   /* this loop to prevent players from sending multiple lines
    * which can be abused */
-  for (cp = message; *cp != '\0'; cp++)
-    if(!my_isprint(*cp & 0x7f)) {
+  for (cp = message; *cp != '\0'; cp++) {
+    if (*cp == '\n' || *cp == '\r') {
       *cp='\0';
       break;
     }
+  }
 
   /* Server commands are prefixed with '/', which is an obvious
      but confusing choice: even before this feature existed,

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#10014) Can not use non-ASCII characters in chat messages, Mateusz Stefek <=