PDA

View Full Version : How to use QProcess::execute() if the parameter has non-ascii?



yangyunzhao
21st August 2009, 04:53
In my program, I use QProcess::execute() to execute some cmds.
Such as

QString x = "copy a.txt b.txt"
QProcess::execute(x);
It works OK.

But if the "x" has non-ascii.Such as

QString x = "copy c:\中文\a.txt c:\中文\b.txt";
QProcess::execute(x).
It doesn't has any effect.
Could you give me some helps? Thans a lot!!!

franz
21st August 2009, 08:10
Did you escape the backslashes?



QString x = "copy c:\\中文\\a.txt c:\\中文\\b.txt";
QProcess::execute(x).