On quinta-feira, 7 de junho de 2012 11.52.34, Oswald Buddenhagen wrote:
> > I disagree.
>
> you need to provide arguments which refute my "it only makes things
> worse" stance.
>
> > Maybe you'll want to revert this then:
> > https://codereview.qt-project.org/#change,22854
>
> indeed

My argument is the above change: it makes sense to me. And because I do not
accept the argument that the command-line should have its own encoding. On
Unix, it's raw 8-bit C strings.

Imagine a Qt application run from the command-line with:

        qtapp *

In that directory there is a file name with broken encoding. The shell will not
recode (which is why I don't by the command-line encoding argument). The Qt
application should be expected to work and interpret it that argument
properly.

If we do this for the input (the command-line to this application), we need to
do it to the output too (the command-line to other applications). E.g.:

int main(int argc, char **argv)
{
    QCoreApplication app(argc, argv);
    QProcess proc;
    proc.start("otherapp", app.arguments());
    return proc.waitForFinished() ? proc.exitCode() : 1;
}

If app.arguments() contains escaped QStrings, then QProcess must unescape them
when calling out to other applications.

--
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
     Intel Sweden AB - Registration Number: 556189-6027
     Knarrarnäsgatan 15, 164 40 Kista, Stockholm, Sweden

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to