I want to set encoding for a Windows console process for Russian ouput. In C# the Process
has a StandardOutputEncoding
attribute, but in Qt no such functionality exists.
Here is the problem:
Any suggestion how to accomplish it?
Update:
I have tried QTextStream
setCodec
function:
void Test1::getData(QByteArray data)
{
QTextStream encodeStream(data);
encodeStream.setCodec("windows-1251");
dataTextBrowser->append(encodeStream.readAll());
emit dataFinished();
}
Result:
Thanks to Michael O. I have fixed the issue. Also, I included the code here, so others can find the solution.
Code:
void Test1::getData(QByteArray data)
{
QTextStream encodeStream(data);
encodeStream.setCodec("IBM 866");
dataTextBrowser->append(encodeStream.readAll());
emit dataFinished();
}