Fri Feb 13 13:53:45 CET 2004 Jochen Eisinger <jochen@penguin-breeder.org>
authorJochen Eisinger <coffee@silcnet.org>
Fri, 13 Feb 2004 12:55:22 +0000 (12:55 +0000)
committerJochen Eisinger <coffee@silcnet.org>
Fri, 13 Feb 2004 12:55:22 +0000 (12:55 +0000)
* Convert all commands to UTF-8 before passing them to the
  client library.  Still need to convert replies from UTF-8 to
  the locale encoding.  Affected file
  irssi/src/silc/core/silc-cmdqueue.c

CHANGES
apps/irssi/src/silc/core/silc-cmdqueue.c

diff --git a/CHANGES b/CHANGES
index 11263b3bc6d16ccc799bd99a0aba95771eef45a8..f3e80188127a3aa75aa5003dd094c8a90e0e7f2a 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,10 @@
+Fri Feb 13 13:53:45 CET 2004  Jochen Eisinger <jochen@penguin-breeder.org>
+
+       * Convert all commands to UTF-8 before passing them to the
+         client library.  Still need to convert replies from UTF-8 to
+         the locale encoding.  Affected file 
+         irssi/src/silc/core/silc-cmdqueue.c
+         
 Fri Feb 13 13:13:07 CET 2004  Jochen Eisinger <jochen@penguin-breeder.org>
 
        * redirect all silc_client_command_calls through a queueing framework.
index e2b889274282489242be74a8e1cb0c5746b94597..dac89bdd3e55c64f90418c49cd4114ad5e46f389 100644 (file)
@@ -100,7 +100,30 @@ bool silc_queue_command_call(SilcClient client,
 
   va_end(ap);
 
-  /* FIXME: UTF-8-tify parameters of cmd */
+  if (!silc_term_utf8()) {
+    int len = silc_utf8_encoded_len(cmd, strlen(cmd), SILC_STRING_LANGUAGE);
+    char *message = silc_calloc(len + 1, sizeof(*cmd));
+    if (message == NULL) {
+
+      if (need_free)
+        g_free(cmd);
+
+      g_critical("file %s: line %d: assertion `message != NULL' failed.",
+                __FILE__, __LINE__);
+
+      return FALSE;
+    }
+    silc_utf8_encode(cmd, strlen(cmd), SILC_STRING_LANGUAGE,
+                    message, len);
+
+    if (need_free)
+      g_free(cmd);
+
+    need_free = TRUE;
+    cmd = g_strdup(message);
+
+    silc_free(message);
+  }
 
   /* queueing disabled -> immediate execution */
   if (list == NULL) {