Important: Please read the Qt Code of Conduct -

How to Get QProcess Text ?

  • I have Qt 5.4 version and
    Linux 64 Bit & Windows 8 64 Bit are used.

    I am using Hangeul.

    Write / home / "바탕화면" on QProcess,
    QByteArray byteArray = process-> readAllStandardOutput ();
    byteArray is represented by strange characters and numbers, such as / home / -24.

    When executed, all Hangul characters are displayed strangely.

    Is there any way to get Hangeul normally?


  • Try class QTextCodec, the example code:

    QByteArray encodedString = "...";
    QTextCodec *codec = QTextCodec::codecForName("KOI8-R");
    QString string = codec->toUnicode(encodedString);

    p.s. KOI8-R is for Russian.

Log in to reply