My question is same as this unanswered question ?
How to read Unicode XML values with rapidxml
But the content of my XML is encoded in UTF-8. I am a newbie to MS Visual Studio, C++.
My question is, How do we read an UTF-8 string into a wchar_t type string ?
Say, I define a structure like this,
typedef struct{
vector<int> stroke_labels;
int stroke_count;
wchar_t* uni_val;
}WORD_DETAIL;
and when I read the value from xml i use..
WORD_DETAIL this_detail;
this_detail.uni_val=curr_word->first_node("labelDesc")->first_node("annotationDetails")->first_node("codeSequence")->value();
But the utf-8 strings that are being stored are not as expected. They are corrupted characters.
My questions are:
- How can I use rapidxml to read Unicode/Utf-8 values ?
- Are there any more simple xml parsers that do the same thing ?
- Any example code will be deeply appreciated.
In section 2.1 here it is mentioned
"Note that RapidXml performs no decoding - strings returned by name() and value() functions will contain text encoded using the same encoding as source file."
If the encoding of my XML is UTF-8 , what is the best way to get the return value of ->value() function ?
Thanks in advance.