[Development] Deprecating QFile::encodeName/decodeName

Thiago Macieira thiago.macieira at intel.com
Thu Jun 7 13:02:31 CEST 2012


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20120607/651ffa75/attachment.sig>


More information about the Development mailing list