comparison mcabber/src/commands.c @ 461:1d8f5b3a5f2b

Convert /rawxml argument to UTF8
author Mikael Berthe <mikael@lilotux.net>
date Wed, 28 Sep 2005 21:56:35 +0200
parents d647b92e541f
children d580e87c11ed
comparison
equal deleted inserted replaced
460:b1910d8821ab 461:1d8f5b3a5f2b
900 } 900 }
901 901
902 static void do_rawxml(char *arg) 902 static void do_rawxml(char *arg)
903 { 903 {
904 if (!strncasecmp(arg, "send ", 5)) { 904 if (!strncasecmp(arg, "send ", 5)) {
905 gchar *buffer;
905 for (arg += 5; *arg && *arg == ' '; arg++) 906 for (arg += 5; *arg && *arg == ' '; arg++)
906 ; 907 ;
908 buffer = g_locale_to_utf8(arg, -1, NULL, NULL, NULL);
909 if (!buffer) {
910 scr_LogPrint(LPRINT_NORMAL, "Conversion error in XML string");
911 return;
912 }
907 scr_LogPrint(LPRINT_NORMAL, "Sending XML string"); 913 scr_LogPrint(LPRINT_NORMAL, "Sending XML string");
908 jb_send_raw(arg); 914 jb_send_raw(buffer);
915 g_free(buffer);
909 } else { 916 } else {
910 scr_LogPrint(LPRINT_NORMAL, "Please read the manual page" 917 scr_LogPrint(LPRINT_NORMAL, "Please read the manual page"
911 " before using /rawxml :-)"); 918 " before using /rawxml :-)");
912 } 919 }
913 } 920 }