I learning Qt, with Qt5.1 and I'm have coding problems in accentuation. I write programs with outputs in Portuguese and always have to use accents. The problem can be demonstrated in the following code:
\#include < QDebug>
\#include < QTextStream>
\#include < QString>
int main(){
QTextStream out(stdout);
qDebug() << "Olá Mundo!";
out << QString("Olá Mundo!") << endl;
out << "Olá Mundo!" << endl;
}
- "Olá Mundo" is Hello World in Portuguese.
The output is:
Olá Mundo!
Olá Mundo!
Olá Mundo!
This third "Olá Mundo" is wrong. I always have to use QString to print the output correctly, or is there some way to make the last line print correctly (without Qstring declaration)? And why qDebug shows correctly?