Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-63775

QProcess no pass correctly non ASCII arguments

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Not Evaluated
    • None
    • 5.9.2
    • Core: Other
    • None
    • Windows 10 Home

      QT 5.9.2

    Description

      When pass an argument to QProcess that contains some character that isn't an ASCII character, the called program receives that character like a ?

      To test it:

      • Download pdfbox-app-2.0.7.jar from Apache pdfbox, https://pdfbox.apache.org/download.cgi.
      • Put the jar on the same directory than the .exe.
      • Do a test with this code:
           QString program = "java";
            QStringList arguments;
            arguments << "-jar";
            arguments << QCoreApplication::applicationDirPath() + "/pdfbox-app-2.0.7.jar";
            arguments << "ExtractText";
            arguments << "-debug";
            arguments << "c:\España.pdf"
                      << "raw_pdf.txt";
        
            QProcess *myProcess = new QProcess(this);
            connect(myProcess, &QProcess::errorOccurred, [this](QProcess::ProcessError error) \{
                qDebug() << error;
            });
            connect(myProcess, &QProcess::readyReadStandardError, [myProcess, this] \{
                QByteArray result = myProcess->readAllStandardError();
                qDebug() << result;
            });
            connect(myProcess, &QProcess::readyReadStandardOutput, [myProcess, this] \{
                QByteArray result = myProcess->readAllStandardOutput();
                qDebug() << result;
            });
            myProcess->start(program, arguments);
            myProcess->waitForStarted();
            myProcess->waitForFinished();
            delete myProcess;
        

         

      You could see than the program receives c:\Espa?a.pdf

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            thiago Thiago Macieira
            lqsa lqsa
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes