[xml] Country specific letters



        xmlDocPtr  doc      = NULL;
        xmlNodePtr node     = NULL;

        doc  = xmlNewDoc((const unsigned char *)"1.0");
        node = xmlNewDocNode(doc, NULL, (const unsigned char *)"DOCUMENTATION",
NULL);
        xmlDocSetRootElement(doc, node);
        node = xmlNewChild(node, NULL, (const unsigned char *)"CLASS", NULL);
        node = xmlNewChild(node, NULL, (const unsigned char *)"NAME", (const
xmlChar*)"class_Name");
===>    node = xmlNewChild(node, NULL, (const unsigned char *)"DESCRIPTION",
(const xmlChar*)"a text with &, é, à... that is special letters");

        xmlSaveFile((const char *)"c:\\trydoc.xml", doc);

        xmlFreeDoc(doc);

Hello, I have this code (see above), which works quite well, until I put the
line with the arrow : it doesn't want to read the document when I want to
insert an element with special letters like &, é, à... I think it's a
problem of encoding, what is the code I must add, if I want to read quite
well what I wrote?

        Thank a lot,

                Antoine.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]