Hi guys,

I'm playing now with QProcess and external console applications. The console application is accepting image file name as a command line parameter. The problem is that image file names may be weird and contain Unicode symbols (umlauts, greek symbols) wich are not included into ASCII or Local 8 Bit encoding on my computer.

I use the following code for launching console utility:

Qt Code:
  1. QProcess process_exiflist;
  2. QStringList exiflist_params;
  3. exiflist_params << "/o";
  4. exiflist_params << "a";
  5. exiflist_params << fileName;
  6. process_exiflist.start(utils_exiflist_exe, exiflist_params);
To copy to clipboard, switch view to plain text mode 

The problem occurs when QProcess passes file name to the console application. Qt libs performs conversion of QString into char* (which is normal) and this char* contains locally encoded file name. But local encoding does not contain some Unicode symbols and console application can not find the file specified

The ideal solution would be to make console application to understand UTF-8 encoded command line parameters. Let's suppose I have such an application. The question is: how to make QProcess to encode QString into UTF-8 rather that in Local encoding.

Thanks