Name:
Qt / C++ / UNICODE
2011-03-18 19:02
When i run this:
QString Converter::Etruscan(int input)
{
const QChar etruscan[5] = { 'Ж', '↑', 'X', 'Λ', 'I' };
const int decimal[5] = { 100, 50, 10, 5, 1 };
QString romanvalue = "";
for (int i = 0; i < 5; i++)
{
while (input >= decimal[i])
{
input -= decimal[i];
romanvalue += etruscan[i];
}
}
return romanvalue;
};
This line:
>etruscan[5] = { 'Ж', '↑', 'X', 'Λ', 'I' };
Is read in as if it was this line:
>etruscan[5] = { '?', '?', 'X', '?', 'I' };
Why can't it store and print unicode characters?