I've an XML file in UTF-8.
It contains some chinese characters ( both simplified chinese and
traditional chinese).
In loading the XML file with MSXML parser, I used the below code to retrieve
the data in a node. The CString was then display in CListCtrl. For the
traditional chinese characters, they were shown correctly, but for
simplified characters, I encounted many "?", but some characters were
correct.
if (MSXML::NODE_EL EMENT == pChild->nodeType)
{
MSXML::IXMLDOMN amedNodeMapPtr pAttrs = pChild->attributes;
MSXML::IXMLDOMN odePtr pAttr;
pAttr = pAttrs->getNamedItem(L "id");
CString id = OLE2T(pAttr->text);
MSXML::IXMLDOMN odePtr pWording = pChild->firstChild;
CString wording = OLE2T(pWording->text);
//add the wording to language
pMessageLanguag e->m_wordingList. insert(MessageW ordingListPair( id,
wording) );
}
It contains some chinese characters ( both simplified chinese and
traditional chinese).
In loading the XML file with MSXML parser, I used the below code to retrieve
the data in a node. The CString was then display in CListCtrl. For the
traditional chinese characters, they were shown correctly, but for
simplified characters, I encounted many "?", but some characters were
correct.
if (MSXML::NODE_EL EMENT == pChild->nodeType)
{
MSXML::IXMLDOMN amedNodeMapPtr pAttrs = pChild->attributes;
MSXML::IXMLDOMN odePtr pAttr;
pAttr = pAttrs->getNamedItem(L "id");
CString id = OLE2T(pAttr->text);
MSXML::IXMLDOMN odePtr pWording = pChild->firstChild;
CString wording = OLE2T(pWording->text);
//add the wording to language
pMessageLanguag e->m_wordingList. insert(MessageW ordingListPair( id,
wording) );
}
Comment