Solved Setting Unicode Char to QComboBox
-
I'm trying to add a € char in a QComboBox, but all my attempts gave � as result.
I tried:- comboBox->addItem("€");
- comboBox->addItem("\u20ac");
- comboBox->addItem("QString::fromUtf8(\u20ac"));
How can I let comboBox display properly unicode chars?
-
@TheEnigmist Works for me.
On which OS are you, which Qt version? Also, is your source code stored as UTF-8? -
@jsulm Wow, what a stupid coder I'm! The problem was that source file was set as ANSI and not as UTF-8!
I'm actually working on Windows 10 x64, Qt version 5.11.2 and I'm coding with Visual Studio 2017.
For some readon the .cpp file was setted as ANSI instead of UTF8