Yes, other programs can open such files. I tested with a file named "that's_all.odt" which is opened by open office without problems. Also winamp can open a "that's_all.mp3" file.
I've made a small program which can be used to test this problem. It simply displays the arguments in a QLabel:
main.cpp:
#include <QApplication>
#include <QLabel>
int main(int argc, char *argv[])
{
for (int n= 0; n < a.argc(); n++) {
//QString argument = QString( a.argv()[n] );
s
+= QString("arg # %1: <b>%2</b><br>").
arg(n
).
arg(argument
);
}
label.setText(s);
label.show();
return a.exec();
}
#include <QApplication>
#include <QLabel>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QLabel label;
QString s;
for (int n= 0; n < a.argc(); n++) {
QString argument = QString::fromLocal8Bit( a.argv()[n] );
//QString argument = QString( a.argv()[n] );
s += QString("arg # %1: <b>%2</b><br>").arg(n).arg(argument);
}
label.setText(s);
label.show();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
test.pro:
SOURCES = main.cpp
#CONFIG += console
SOURCES = main.cpp
#CONFIG += console
To copy to clipboard, switch view to plain text mode
Running test.exe "that's all", displays as arg #1 "thats all".
test.exe "that\'s all" properly displays "that's all".
But right-clicking in the explorer on a filename with an apostrophe, and selecting to open it with test.exe displays the file without the apostrophe.
Removing the QString::fromLocal8Bit() call doesn't make any difference.
But uncommenting the #CONFIG += console line in the pro file magically fixes the problem.
Now test.exe "that's all" displays "that's all".
This is with Qt 4.3.0 in Windows. I haven't tested it with another version.
Bookmarks