Remove IRC colors from the body when forwarding it to XMPP

This commit is contained in:
Florent Le Coz
2013-11-09 21:40:29 +01:00
parent af5548897a
commit f38b31a63e
3 changed files with 25 additions and 4 deletions
+5
View File
@@ -6,6 +6,7 @@
#include <iostream>
#include <bridge/colors.hpp>
#include <utils/encoding.hpp>
#include <string.h>
@@ -39,5 +40,9 @@ int main()
// wrong charset)
std::string from_ascii = utils::convert_to_utf8(original_latin1, "US-ASCII");
assert(from_ascii == "couc�ou");
std::string coucou("\u0002\u0002COUCOU\u0003");
remove_irc_colors(coucou);
assert(coucou == "COUCOU");
return 0;
}