From: Jochen Eisinger Date: Fri, 13 Feb 2004 12:55:22 +0000 (+0000) Subject: Fri Feb 13 13:53:45 CET 2004 Jochen Eisinger X-Git-Tag: silc.server.0.9.17~27 X-Git-Url: http://git.silcnet.org/gitweb/?a=commitdiff_plain;h=9d5a18d2e4bf07b3cbd2db1519f47f3ba88d5d89;p=silc.git Fri Feb 13 13:53:45 CET 2004 Jochen Eisinger * 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 --- diff --git a/CHANGES b/CHANGES index 11263b3b..f3e80188 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,10 @@ +Fri Feb 13 13:53:45 CET 2004 Jochen Eisinger + + * 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 * redirect all silc_client_command_calls through a queueing framework. diff --git a/apps/irssi/src/silc/core/silc-cmdqueue.c b/apps/irssi/src/silc/core/silc-cmdqueue.c index e2b88927..dac89bdd 100644 --- a/apps/irssi/src/silc/core/silc-cmdqueue.c +++ b/apps/irssi/src/silc/core/silc-cmdqueue.c @@ -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) {