libpurple/protocols/yahoo/yahoo_profile.c

changeset 35688
3d727b2e6f82
parent 34878
41b9075c7714
child 35834
5eb0ba6d126d
child 37133
832cd077145e
equal deleted inserted replaced
35687:cc08e570d7d5 35688:3d727b2e6f82
976 /* Jun 29 05 Bleeter: Y! changed their profile pages. Terminators now seem to be */ 976 /* Jun 29 05 Bleeter: Y! changed their profile pages. Terminators now seem to be */
977 /* </dd> and not \n. The prpl's need to be audited before it can be moved */ 977 /* </dd> and not \n. The prpl's need to be audited before it can be moved */
978 /* in to purple_markup_strip_html*/ 978 /* in to purple_markup_strip_html*/
979 char *fudged_buffer; 979 char *fudged_buffer;
980 980
981 g_return_if_fail(strings != NULL);
982
981 yd = purple_connection_get_protocol_data(info_data->gc); 983 yd = purple_connection_get_protocol_data(info_data->gc);
982 984
983 fudged_buffer = purple_strcasereplace(url_buffer, "</dd>", "</dd><br>"); 985 fudged_buffer = purple_strcasereplace(url_buffer, "</dd>", "</dd><br>");
984 /* nuke the html, it's easier than trying to parse the horrid stuff */ 986 /* nuke the html, it's easier than trying to parse the horrid stuff */
985 stripped = purple_markup_strip_html(fudged_buffer); 987 stripped = purple_markup_strip_html(fudged_buffer);
987 989
988 purple_debug_misc("yahoo", "stripped = %p\n", stripped); 990 purple_debug_misc("yahoo", "stripped = %p\n", stripped);
989 purple_debug_misc("yahoo", "url_buffer = %p\n", url_buffer); 991 purple_debug_misc("yahoo", "url_buffer = %p\n", url_buffer);
990 992
991 /* convert to utf8 */ 993 /* convert to utf8 */
992 if (strings && strings->charset) { 994 if (strings->charset) {
993 p = g_convert(stripped, -1, "utf-8", strings->charset, 995 p = g_convert(stripped, -1, "utf-8", strings->charset,
994 NULL, NULL, NULL); 996 NULL, NULL, NULL);
995 if (!p) { 997 if (!p) {
996 p = g_locale_to_utf8(stripped, -1, NULL, NULL, NULL); 998 p = g_locale_to_utf8(stripped, -1, NULL, NULL, NULL);
997 if (!p) { 999 if (!p) {
1007 } 1009 }
1008 } 1010 }
1009 p = NULL; 1011 p = NULL;
1010 1012
1011 /* "Last updated" should also be converted to utf8 and with &nbsp; killed */ 1013 /* "Last updated" should also be converted to utf8 and with &nbsp; killed */
1012 if (strings && strings->charset) { 1014 if (strings->charset) {
1013 last_updated_utf8_string = g_convert(last_updated_string, -1, "utf-8", 1015 last_updated_utf8_string = g_convert(last_updated_string, -1, "utf-8",
1014 strings->charset, NULL, NULL, NULL); 1016 strings->charset, NULL, NULL, NULL);
1015 yahoo_remove_nonbreaking_spaces(last_updated_utf8_string); 1017 yahoo_remove_nonbreaking_spaces(last_updated_utf8_string);
1016 1018
1017 purple_debug_misc("yahoo", "after utf8 conversion: stripped = (%s)\n", stripped); 1019 purple_debug_misc("yahoo", "after utf8 conversion: stripped = (%s)\n", stripped);

mercurial