I'm trying to parse a string character per character so I can load an image depending on every letter. So if the text is "Hello" i will print 5 images that are the same letters but made in photoshop. It works fine until I want to parse the € symbol.
std::string al = "Test €";
std::string letter="";
for (int i=0; i< al.length();++i)
{
if (al[i]=='.') letter ="dot";
else if (al[i]==',') letter ="coma";
else if (al[i]==' ') letter ="space";
//else if (al[i]=='€') letter ="euro";
else letter=al[i];
}
This works fine: letter
will adquire the values:"T","e","s","t","space"
but if I uncomment the else if (al[i]=='€') letter ="euro";
and try to build it, then I receive a red mesage error that says:
warning: multi-character character constant
So the thing is that I need to know if al[i] is the € symbol to be able to assing "euro" to letter (then my code will be able to work with it)
I've search on google and found that link which says that "\u20AC"
is the c++ code for the € and I suppose that the symbol needs more than a byte maybe, but still can't find how to deal with it and be able to parse it in my code. Any Idea of how could I do it?
Thank you so much.
Note: I don't know the C++ version used (dunno where I can check it) but I know its not c++11