Details
-
Bug
-
Resolution: Won't Do
-
Not Evaluated
-
None
-
5.9.2
-
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