char *topic, *name;
int usercount;
char users[20];
+ char tmp[256], *cp, *dm = NULL;
if (!success)
return;
name = va_arg(vp, char *);
topic = va_arg(vp, char *);
usercount = va_arg(vp, int);
+
+ if (!silc_term_utf8() && silc_utf8_valid(topic, strlen(topic))) {
+ memset(tmp, 0, sizeof(tmp));
+ cp = tmp;
+ if (strlen(topic) > sizeof(tmp) - 1) {
+ dm = silc_calloc(strlen(topic) + 1, sizeof(*dm));
+ cp = dm;
+ }
+
+ silc_utf8_decode(topic, strlen(topic), SILC_STRING_LANGUAGE,
+ cp, strlen(topic));
+ topic = cp;
+ }
if (status == SILC_STATUS_LIST_START ||
status == SILC_STATUS_OK)
printformat_module("fe-common/silc", server, NULL,
MSGLEVEL_CRAP, SILCTXT_LIST,
name, users, topic ? topic : "");
+ silc_free(dm);
}
break;
{
SilcChannelEntry channel;
char *topic;
+ char tmp[256], *cp, *dm = NULL;
if (!success)
return;
channel = va_arg(vp, SilcChannelEntry);
topic = va_arg(vp, char *);
-
+
+ if (!silc_term_utf8() && silc_utf8_valid(topic, strlen(topic))) {
+ memset(tmp, 0, sizeof(tmp));
+ cp = tmp;
+ if (strlen(topic) > sizeof(tmp) - 1) {
+ dm = silc_calloc(strlen(topic) + 1, sizeof(*dm));
+ cp = dm;
+ }
+
+ silc_utf8_decode(topic, strlen(topic), SILC_STRING_LANGUAGE,
+ cp, strlen(topic));
+ topic = cp;
+ }
+
if (topic) {
chanrec = silc_channel_find_entry(server, channel);
if (chanrec) {
MSGLEVEL_CRAP, SILCTXT_CHANNEL_TOPIC_NOT_SET,
channel->channel_name);
}
+ silc_free(dm);
}
break;