Answer the question
In order to leave comments, you need to log in
QT and Cyrillic in COM?
Hello!! I receive data from the COM port. The device transmits data in Cyrillic.
Accordingly, I have krakozyabry. How can I fix it?
Used TextCodec but doesn't help.
Here is the code:
QString byte;
QByteArray data;
byte=serialPort->readAll();
data+=byte;
QTextCodec::setCodecForLocale(QTextCodec::codecForName("Windows-1251"));
QString cyrillicName = QString::fromLocal8Bit(data);
Answer the question
In order to leave comments, you need to log in
First, figure out in what encoding these characters come to you.
At a minimum, the encoding is called cp1251 , not what you wrote.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question