Answer the question
In order to leave comments, you need to log in
Why is Cyrillic displayed incorrectly in the interface?
Hello Toaster!
The problem is that when adding Cyrillic to the interface using code, for example like this (in QComboBox):
ui->userList->addItem("Стандартный пользователь");
ui->userList->addItem(tr("Стандартный пользователь"));
ui->userList->addItem(trUtf8("Стандартный пользователь"));
Answer the question
In order to leave comments, you need to log in
Because Qt expects unicode strings.
QTextCodec *codec = QTextCodec::codecForName("Windows-1251");
ui->userList->addItem(codec->toUnicode("Standard User"));
Try this code, it should work.
Do not do it this way:
ui->userList->addItem(tr("Стандартный пользователь"));
ui->userList->addItem(trUtf8("Стандартный пользователь"));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question