# HG changeset patch # User Will Thompson # Date 1197300147 0 # Node ID d62d7412eca4215ca802bacb9a5366c32defcc45 # Parent 937623b190a2f896eb6b2c62478317ddd6bf6485 Ensure that an error's description actually is UTF-8 before writing it out to accounts.xml. It might not be if a prpl uses strerror rather than g_strerror, for example. Fixes #4264. diff -r 937623b190a2 -r d62d7412eca4 libpurple/account.c --- a/libpurple/account.c Mon Dec 10 13:10:58 2007 +0000 +++ b/libpurple/account.c Mon Dec 10 15:22:27 2007 +0000 @@ -336,8 +336,13 @@ xmlnode_insert_data(child, type_str, -1); child = xmlnode_new_child(node, "description"); - if(err->description) - xmlnode_insert_data(child, err->description, -1); + if(err->description) { + char *utf8ized = purple_utf8_try_convert(err->description); + if(utf8ized == NULL) + utf8ized = purple_utf8_salvage(err->description); + xmlnode_insert_data(child, utf8ized, -1); + g_free(utf8ized); + } return node; }