I'm using msxml3 for instance like this:
// IXMLDOMNode* attribute_node;
// VARIANT varAttributeValue;
attribute_node->get_nodeValue(&varAttributeValue);
BSTR bstrAttributeValue = V_BSTR(&varAttributeValue);
Even if the original XML file has either UTF-8 or ISO-8859-1 encoding, and
contains diacretic symbols encoded as entities ("é"), this BSTR will
contain these entities as "normal" ASCII values. Of course, one could
translate these values back by parsing the attribute value, but this would
cause a performance hit *twice*.
Is there a more elegant solution to this? Would this require _bstr_t, or a
stream with a specified encoding or such? I'm really looking forward to know
about this.
Regards,
Toine de Greef