"/room whois": correctly display utf8 resources
authorMikael Berthe <mikael@lilotux.net>
Sat, 10 Dec 2005 20:15:04 +0100
changeset 588 49f132b434a3
parent 587 1b773c760a99
child 589 9942746e8d58
"/room whois": correctly display utf8 resources
mcabber/src/commands.c
--- a/mcabber/src/commands.c	Sat Dec 10 19:06:01 2005 +0100
+++ b/mcabber/src/commands.c	Sat Dec 10 20:15:04 2005 +0100
@@ -1514,8 +1514,14 @@
   scr_WriteIncomingMessage(jid, buffer, 0, HBB_PREFIX_INFO);
 
   if (realjid) {
-    snprintf(buffer, 127, "JID      : <%s>", realjid);
+    gchar *rjid_noutf8 = from_utf8(realjid);
+    if (!rjid_noutf8)
+      scr_LogPrint(LPRINT_LOGNORM, "Decoding of real JID has failed: %s",
+                   realjid);
+    snprintf(buffer, 127, "JID      : <%s>", rjid_noutf8);
     scr_WriteIncomingMessage(jid, buffer, 0, HBB_PREFIX_INFO);
+    if (rjid_noutf8)
+      g_free(rjid_noutf8);
   }
 
   snprintf(buffer, 127, "Role     : %s", strroles[role]);