My C++ application receives a string that contains some wchars (in particular, the string is printed like this: "€¥$₱"). I have to parse it so that it returns a vector of strings where each element of the vector is one of the characters of the string (so the desired output is [€, ¥, $, ₱]). I have tried with this snippet of code:
for(auto letter : originalString)
{
outputVector.push_back(std::string(1, letter));
}
But, as you can correctly guess, the output isn't correct because, at least as I understood, some of the characters of the original string are bigger than a char. How can i correctly parse this string containing characters and what appears to be wchars? Would it be enough to cast the received string to a wstring, then parse the wstring?