+
+
+
+ memset(&ri, 0, sizeof(rss_item));
+ ri.roomlist = Cfg->rooms;
+ rssc.CData = NewStrBufPlain(NULL, SIZ);
+ rssc.Key = NewStrBuf();
+ at = NULL;
+ StrBufSipLine(rssc.Key, Answer, &at);
+ ptr = NULL;
+
+#define encoding "encoding=\""
+ ptr = strstr(ChrPtr(rssc.Key), encoding);
+ if (ptr != NULL)
+ {
+ char *pche;
+
+ ptr += sizeof (encoding) - 1;
+ pche = strchr(ptr, '"');
+ if (pche != NULL)
+ StrBufCutAt(rssc.Key, -1, pche);
+ else
+ ptr = "UTF-8";
+ }
+ else
+ ptr = "UTF-8";
+
+
+ xp = XML_ParserCreateNS(ptr, ':');
+ if (!xp) {
+ CtdlLogPrintf(CTDL_ALERT, "Cannot create XML parser!\n");
+ goto shutdown;
+ }
+ FlushStrBuf(rssc.Key);
+//#ifdef HAVE_ICONV
+#if 0
+ XML_SetUnknownEncodingHandler(xp,
+ handle_unknown_xml_encoding,
+ &rssc);
+#endif
+//#endif
+ XML_SetElementHandler(xp, rss_xml_start, rss_xml_end);
+ XML_SetCharacterDataHandler(xp, rss_xml_chardata);
+ XML_SetUserData(xp, &rssc);
+ XML_SetCdataSectionHandler(xp,
+ rss_xml_cdata_start,
+ rss_xml_cdata_end);
+
+
+ len = StrLength(Answer);
+ ptr = SmashStrBuf(&Answer);
+ XML_Parse(xp, ptr, len, 0);
+ free (ptr);